COBOL Manual for TNS and TNS/R Programs
Using HP COBOL in the OSS Environment
HP COBOL Manual for TNS and TNS/R Programs—522555-006
19-21
REWRITE Statement
imperative-stmt-1
is an imperative statement to be performed when the end of the file is encountered
at the beginning of the read operation. This phrase is required if no USE statement
is applicable for the file. If both a USE statement and an AT END phrase are
present, only the AT END phrase is used.
imperative-stmt-2
is an imperative statement to be performed when the end of the file is not
encountered at the beginning of the read operation.
END-READ
ends the scope of the READ statement, causing the READ to be a delimited-scope
statement. If the READ statement does not end with an END-READ phrase, the
presence of the AT END or the NOT AT END phrase causes the READ statement
to be a conditional statement, which ends at the next period separator.
REWRITE Statement
The REWRITE statement for a line sequential file has this syntax:
record-name
is the record-name in an file description entry whose current contents replaces a
record in the file. The file must be open in I-O mode.
data-name
is the identifier of the item that contains the new record instead of record-name.
When this phrase is used, an implicit MOVE statement occurs to copy the data to
record-name before the rewrite operation occurs. data-name cannot specify
an index-name or an index data item. data-name cannot specify a data item
allocated within the record area in which record-name is located.
REWRITE
END-REWRITE
record-name
FROM data-name
VST721.vsd