GET reads a record.
The user is offered two subcodes for record selection.
SUBCODE=SEQ
The next record, relative to the last GET call with the same access path identification, is output to the ER field. During the call, only fields REC-ACC-ID (see OPENGET) and BUFFER-LEN need to be supplied. The record buffer must have been set to length BUFFER-LEN. After reading, the record type and number are stored in fields RECORD-TYPE and RECORD-NR of RD respectively. When the end of the member is reached, X’08’ is written to the RETURNCODE field of CB. A change of the record type does not cause a message but can be recognized by analyzing the RECORD-TYPE field.SUBCODE=DIR
The RECORD-TYPE and RECORD-NR fields must also be defined. The record identified by RECORD-TYPE and RECORD-NR of RD (retrieval address) is output. If the record is not available, X’0C’ is written to the RETURNCODE field of CB. RD and ER remain unchanged.
SEQ and DIR may be freely combined.
When a record is read, the record header in ER is supplied by LMS. The record length value is set either to the record length of the record read or to the buffer length specified by the user in RD, whichever is the smaller. This is the maximum length in which the record is transferred. If the record is too long, X’04’ is written to the RETURNCODE field of CB. The record length/type specifications in ER are transferred to the corresponding fields of RD.
After reading, fields RECORD-TYPE and RECORD-LEN of RD contain the record type and length respectively and RECORD-NR contains the record number relative to the record type. RD contains the true record length which can be used in the event of an error to calculate the buffer length.
GET can be used, for instance, to read records of various record types alternately. If a member has been opened with OPENGET, it cannot be overwritten.
Record types 1-159, 163 and 164 can be read (see "Format of the secondary record (record type 163)").
Members containing format B records cannot be read with GET unless the EXTRA subcode is set in the OPENGET function.
When a format B record is read, sets the following values:
ER is the format B record without its 4-byte header. The ER buffer must be 256K long.
RECORD-LEN is the original length of the format B record
RECORD-TYPE is record type 160
RECORD-NR is the record number relative to the record type
Call parameters
The parameter structures must be given in the following sequence in the subroutine call.
Parameter | Field | Meaning |
CB | SCBVERSION FUNCTION ACC SUBCODE | Function control block Interface version Function code X’11’ Subroutine access identification Subcode (DIR or SEQ) |
RD | REC-ACC-ID BUFFER-LEN RECORD-TYPE RECORD-NR | Record descriptor Access path identification Buffer length of ER Record type (optional for SEQ) Record number (optional for SEQ) |
ER | - | Member record area Does not have to be supplied |
Return parameters
Parameter | Field | Meaning |
CB | RETURNCODE LMS-MSG DMS-MSG PLAM-MSG | Function control block Return code LMS message code DMS message code PLAM message code |
RD | RECORD-LEN RECORD-TYPE RECORD-NR | Record descriptor Record length Record type Record number |
ER | Member record area Record contents (including 4-byte record header) |