The REWRITE statement logically replaces a mass storage file record.
1 – 1format_sequential
Format 1 -
REWRITE rec-name [ FROM src-item ] [ ALLOWING NO OTHERS ]
[ END-REWRITE ]
1.1 – rec-name
is the name of a logical record in the Data Division File Section. It can be qualified.
1.2 – src-item
is the identifier of the data item that contains the data. If src-item is a function-identifier, it must reference an alphanumeric function.
2 – 2format_relative_indexed
Format 2 -
REWRITE rec-name [ FROM src-item ] [ ALLOWING NO OTHERS ]
[ INVALID KEY stment ] [ NOT INVALID KEY stment ]
[ END-REWRITE ]
2.1 – rec-name
is the name of a logical record in the Data Division File Section. It can be qualified.
2.2 – src-item
is the identifier of the data item that contains the data. If src-item is a function-identifier, it must reference an alphanumeric function.
2.3 – stment
is an imperative statement.