| |
The first point to be noted is that in the case of
the READ statement the file name is to be specified,
whereas in the case of the WRITE statement it is required
to mention the record name an not the file name. The
ADVANCING phrase is used to control the vertical positioning
of each record at the time of printing on the stationery
placed on the printer. When the BEFORE phrase is used,
the record is printed before the stationary is advanced,
whereas the AFTER phrase may be used when the intention
is to advance the stationary first and then to print
the record. If integer-1 or identifier-1 is mentioned,
the stationary is advanced by the number of lines
equal to the value of integers-1 or to the current
value of identifier-1.
If the mnemonic-name is specified, the printer will
be advanced to the carriage control channel declared
for the mnemonic-name in the SPECIAL-NAMES paragraph.
This option is provided so that the hardware names
which may be peculiar to a particular computer need
not appear in the PROCEDURE DIVISION.
If the FROM option is used, the operation is identical
to that of MOVE identifier-1 TO record-name followed
by a WRITE record-name without the FROM clause. It
is illegal to use the same storage area for both record-name
and identifier-1.
It should be noted that after WRITE is executed the
record is no longer available.
Example:
|
|
| |
This WRITE statement indicated that TRANS-RECORD is
a record name of a file that has been assigned to
PRINTER. The current position of the stationery will
be advanced by 3 lines, i.e., there will be 2 blank
lines and the present record will be written on the
third line.
|
|