Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

MODIFY-ELEMENT substatements for textual members

These substatements make changes to text members. They are read from the statement stream until the MODIFY-ELEMENT substatement END-MODIFY is encountered.

Overview of MODIFY-ELEMENT substatements

These substatements may be used only for textual members.

MODIFY-ELEMENT substatement

Function

ADD-RECORD

Inserts records

END-MODIFY

Concludes the modifications

REMOVE-RECORD

Removes records

Notes

  • Standard SDF statements are also permitted as MODIFY-ELEMENT substatements (see "SDF standard statements for LMS").

  • Only member records with lengths ≤ 251 are processed. Longer records will be truncated. In this case, LMS issues a warning.

Definition of record identification for textual members

Record identification may be a record number or a record ID.

Record

The record number indicates the relative position of the member record in

number:

relation to the beginning of the member. If the record number specified is
greater than the member’s highest record number, the changes continue
after the last member record, i.e. records are appended to the member.

Record ID:

The location and length of the record ID are specified by means of the
INPUT-RECORD-ID operand (see the MODIFY-ELEMENT statement).
This is why it is not permissible to specify a record ID in substatements
except when INPUT-RECORD-ID has a value other than *NONE. If
specified, a record ID must have the length declared in INPUT-RECORD-
ID. Only leading zeros may be omitted.
If the record ID does not occur in the input member, the changes are
inserted in front of the first record with a higher record ID.

Record numbers and record IDs may be mixed within substatements. In substatements and data records, they must always be specified in ascending order.
If an error is detected in interactive mode, the correction must be terminated with END-MODIFY and then restarted. After an ADD-RECORD substatement, an *END must also be entered.

ADD-RECORD

The MODIFY-ELEMENT substatement ADD-RECORD inserts the records following the statement at the specified position. The records to be inserted must be concluded by an *END record.

ADD-RECORD

RECORD-ID = *NONE / <integer 0..99999999> / <c-string 1..16 with-low>

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.

Statement return code

(SC2)        SC1

Maincode

Meaning

0
1

CMD0001
CMD0230

No error
Syntax error

END-MODIFY

Each sequence of MODIFY-ELEMENT substatements is concluded by an END-MODIFY substatement.

END-MODIFY


This substatement has no operands.

Statement return code

(SC2)

SC1

Maincode

Meaning


2

0
0
1
32
64
64
130

CMD0001
LMS0129
CMD0230
LMS1002
LMS1003
LMS1004
LMS0041

No error
Statement aborted by user
Syntax error
Internal error
Error during wildcard processing with at least one member or file
Other error
System address space exhausted

REMOVE-RECORD

The MODIFY-ELEMENT substatement REMOVE-RECORD deletes the specified record or record area from the member.

REMOVE-RECORD

RECORD-ID = <integer 0..99999999> / <c-string 1..16 with-low> / *RANGE(...)


*RANGE(...)



|

FROM = <integer 0..99999999> / <c-string 1..16 with.low>



|

,TO = <integer 0..99999999> / <c-string 1..16 with.low>

RECORD-ID = <integer 0..99999999> / <c-string 1..16 with-low> / *RANGE(...) Record number or record ID of the record to be deleted.

RECORD-ID = *RANGE(...)
Specifies the record area to be deleted.

FROM = <integer 0..99999999> / <c-string 1..16 with-low>
Specifies the first record number or record ID of the area which is to be deleted.

TO = <integer 0..99999999> / <c-string 1..16 with-low>
Specifies the last record number or record ID of the area which is to be deleted.

Statement return code

(SC2)        SC1

Maincode

Meaning

0
1

CMD0001
CMD0230

No error
Syntax error