WRITE - Format 2 - Indexed and Relative Files >>-WRITE--record-name-1--+--------------------+-----------------> '-FROM--identifier-1-' >--+--------------------------------------+---------------------> | (1) | '-FORMAT------+----+--+-identifier-2-+-' '-IS-' '-literal-1----' >--+----------------------------------------+-------------------> | (1) | '-NULL-KEY-MAP------+----+--identifier-8-' '-IS-' >--+------------------------------------+-----------------------> | (1) | '-NULL-MAP------+----+--identifier-9-' '-IS-' >--+------------------------------------------+-----------------> '-INVALID--+-----+--imperative-statement-1-' '-KEY-' >--+----------------------------------------------+-------------> '-NOT INVALID--+-----+--imperative-statement-2-' '-KEY-' >--+-----------+----------------------------------------------->< '-END-WRITE-'
You must ensure that the size of an OCCURS DEPENDING ON (ODO) array has been set to a valid numeric value before doing a WRITE of a record containing the ODO array.
In the case of relative files, only, the number of character positions in record-name-1 must equal the number of character positions in the record being replaced. It must not be associated with a sort or merge file.
MOVE identifier-1 TO record-name-1
WRITE record-name-1
After the WRITE statement is executed, the information is still available in identifier-1, even though it may not be in record-name-1. (See INTO/FROM Identifier Phrase.)
Record-name-1 and identifier-1 cannot both refer to the same storage area.
Identifier-1 can be the name of an alphanumeric or DBCS function identifier.