Concerning READ vs READ INTO

From:
 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3pg30/1.9.1.1.
3 

"When you specify a READ INTO statement for a format-V file, the record size
read for that file is used in the MOVE statement generated by the compiler.
Consequently, you might not get the result you expect if the record just
read does not correspond to the level-01 record description. All other rules
of the MOVE statement apply. For example, when you specify a MOVE statement
for a format-V record read in by the READ statement, the size of the record
moved corresponds to its level-01 record description. 

When you specify a READ statement for a format-V file followed by a MOVE of
the level-01 record, the actual record length is not used. The program will
attempt to move the number of bytes described by the level-01 record
description. If this number exceeds the actual record length and extends
outside the area addressable by the program, results are unpredictable. If
the number of bytes described by the level-01 record description is shorter
than the physical record read, truncation of bytes beyond the 01-level
description occurs. To find the actual length of a variable-length record,
specify data-name-1 in format 3 of the RECORD clause of the File Definition
(FD)." 

<[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> 1) If you do a READ instead of a READ INTO, the 01 is addressing the 
> buffer with all records left in the current physical record.  So yes, if 
> you look you might see the next record(s).  You might also get an 0C4 if 
> none are present.  If it hurst don't do it.
> 
> 2) the s002 probably means there is a record longer than 1504 (4 for RDW 
> plus 1500) or less than 63 (4 for RDW plus 59).  To find the record, 
> change FD to:
> 
> OCCURS 1 TO 32760.
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to