COBOL Manual for TNS/E Programs (H06.03+)

Using HP COBOL in the OSS Environment
HP COBOL Manual for TNS/E Programs520347-003
19-20
WRITE Statement
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.
END-REWRITE
ends the scope of the REWRITE statement, causing the REWRITE to be a
delimited-scope statement. If the REWRITE statement does not end with an END-
REWRITE phrase, the presence of the INVALID KEY or the NOT INVALID KEY
phrase causes the REWRITE statement to be a conditional statement, which ends
at the next period separator.
WRITE Statement
The WRITE statement for a line sequential file has this syntax:
record-name
is a logical record described in the File Section of the Data Division. The record-
name can be qualified by the name of the file with which the record is associated.
The data written is the current contents of record-name.
from-name
is the identifier of a data area whose contents are to be moved to the record
specified by record-name before the WRITE occurs. from-name must specify
a data area other than that specified by record-name. It cannot specify an index
data item.
END-WRITE
ends the scope of the WRITE statement, causing the WRITE to be a delimited-
scope statement.
record-name
WRITE
FROM from-name END-WRITE
VST631.vsd