The REWRITE statement in XML syntax modifies an XML element in the in-memory representation of the XML document.
Format
Syntax Rules:
- Record-name-1 is the name of an 01 level group item defined in an XD record declaration within the Data Division.
- Data-name-1 can be qualified, and references a data item whose declaration includes an IDENTIFIED BY clause and is included in the XD record declarations for file-name-1.
General Rules:
- No stream I/O is performed by the REWRITE verb.
- REWRITE KEY IS updates the in-memory representation of the elements and child elements associated with data-name-1. All other elements in the in-memory representation remain unchanged.
- If the internal representation of the XML document is modified through the use of WRITE KEY, REWRITE KEY, or DELETE KEY, and the internal representation is cleared with either a CLOSE or READ (no key) statement, then the CLOSE or READ statement returns a status of -10, indicating the operation succeeded but no write was done.