The ADD-RECORD substatement inserts the records following the statement at the specified position. The records to be inserted must be concluded by an *END record.
Format
ADD-RECORD |
RECORD-ID = *NONE / <integer 0..99999999> / <c-string 1..16 with-low> |
Operands
RECORD-ID = *NONE / <integer 0..99999999> / <c-string 1..16 with-low>
Specifies the data record to be added.
RECORD-ID = *NONE
If the INPUT-RECORD-ID operand of the MODIFY-ELEMENT statement is set to a value other than *NONE, the data records following the ADD-RECORD substatement are inserted in the member being modified in accordance with their record IDs.
If a specified record ID designates a record which already exists, the data record is written over the existing record. If no record with the specified record ID yet exists, the data record is inserted in front of the first record with a higher record ID. If INPUT-RECORD-ID=*NONE is set or no record ID is specified for a data record, the record is inserted at the current position.
RECORD-ID = <integer 0..99999999> / <c-string 1..16 with-low>
Specifies the member position after which the data records following the statement are to be inserted. If the specified record number or record ID does not exist, the data records are each inserted in front of the first record with a higher record number/record ID.