‎2008 Jun 11 5:28 PM
I am wondering how the following line works:
READ DATASET w-filename INTO t_imspo.I understand that it will break up the file and put it into the fields contained in t_imspo but how does it break this file apart? What delimiter does it use?
Regards,
Aaron
‎2008 Jun 11 5:34 PM
Aaron,
The Read does not break the record apart and put it into fields of the target.
You have to provide a "buffer" at least as big as you expect the data length to be.
To seperated it into different fields, the input would need to be delimited by something, usually tabs or commas.
You would then use the SPLIT verb to move it to the fields.
‎2008 Jun 11 5:34 PM
Aaron,
The Read does not break the record apart and put it into fields of the target.
You have to provide a "buffer" at least as big as you expect the data length to be.
To seperated it into different fields, the input would need to be delimited by something, usually tabs or commas.
You would then use the SPLIT verb to move it to the fields.
‎2008 Jun 11 5:36 PM
That is what I thought, I had used it that way before, but I just read the help on READ DATASET and it looked like it would split it for me too.
Thanks!
Aaron
‎2008 Jun 11 5:39 PM
The only way it would seperated it on the read, would be that your input "buffer" is actually a record with the exact same length and each field is the same length on the input and the buffer.
ie..
BEGIN OF MYREC,
fld1(10) type c,
fld2(10) type n,
etc.. etc
your input would then HAVE to be in the same format
ZZZZZZZZZZ1234567890.......
‎2008 Jun 11 5:37 PM
Hi Aaron,
It does not consider any delimiter.
The structure of the t_imspo must be identical to the line structure of the file.
Eg: the file has some 30 characters with fixed lengths for each field, then the internal table must be defined as per the field lengths of each field.
data: begin od itab occurs 0,
field1(10),
field2(5),
field3(15),
end of itab.
Regards,
Ravi