If the printed page is held on an intermediate device (a disk, for example), the format, when edited or browsed, may appear different than the expected output.
Format 1 (Sequential Files) ->->---WRITE record-name-1--*-------------------*----------------> *-FROM identifier-1-* ->-*-------------------------------------------------------*----> **-BEFORE-*-*-----------*-*-*-identifier-2-*-*-------*-** *-AFTER--* *-ADVANCING-* + *-integer-1----* *-LINE--* + + *-LINES-* + *-mnemonic-name-1------------* *-PAGE-----------------------* ->----*----------------------------------------------------*----> *-*-----*-*--END-OF-PAGE-*-imperative-statement-1----* *-AT--* *-----EOP------* ->----*----------------------------------------------------*----> *--NOT-*----**-END-OF-PAGE-*-imperative-statement-2--* *-AT-**----EOP------* ->----END-WRITE-------------------------------------------------><-
Record-name-1 must be defined in a Data Division FD entry. Record-name-1 may be qualified, but must not be associated with a sort or merge file.
FROM identifier-1 makes the WRITE statement equivalent to the execution of the following two statements:
The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase.
Identifier-1 must be the name of a Working-Storage Section or Linkage Section entry, or a record description for another previously opened file.
Identifier-1 must be an alphanumeric or numeric-edited item. Data is transferred from this field to the receiving fields.
Identifier-1 and record-name-1 must not refer to the same storage area.
After the WRITE statement has successfully executed, the information is still available in identifier-1, even though it may not be in record-name-1.
The ADVANCING phrase controls the positioning of the output record on the page. If you omit this phrase, AFTER ADVANCING 1 LINE is assumed.
When you specify:
If the FD entry contains a LINAGE clause, the repositioning is to the first printable line of the next page, as specified in that clause. If you omit the LINAGE clause, the repositioning is to line 1 of the next succeeding page.
Integer-1 or the value in identifier-2 may be zero.
If the END-OF-PAGE condition does not exist after the processing of a WRITE statement with the NOT AT END-OF-PAGE phrase, control transfers to imperative-statement-2.
Identifier-2 must be an integer data item.
When you specify END-OF-PAGE, and the logical end of the printed page is reached during execution of the WRITE statement, the END-OF-PAGE imperative statement is executed. When END-OF-PAGE is specified, the FD entry for this file must contain a LINAGE clause. The logical end of the printed page is specified in the associated LINAGE clause.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.