The GET macro retrieves (reads) the next record. Control is not
returned to the problem program until the record is available.
The format of the GET macro is:
[label] |
GET |
dcb address
[,area address]
|
- dcb address—RX-Type Address, (2-12),
or (1)
- specifies the address of the data control block for the opened
input data set being retrieved.
- area address—RX-Type Address, (2-12),
or (0)
- specifies the storage address into which the system is to move
the record (move mode only). Either the move or locate mode can be
used with QISAM, but they must not be mixed in the specified data
control block. The following describes operations for move and locate
modes:
Locate Mode: If locate mode is specified in the
data control block, the area address must
be omitted. The system returns the address of the buffer segment containing
the record in register 1.
Move
Mode: If move mode is specified in the data control block, the area
address must specify the address in the problem program
into which the system will move the record. If the area
address is omitted, the system assumes that register
0 contains the area address. When control is returned to the problem
program, register 0 contains the area address, and register 1 contains
the address of the data control block.
Note: - The end-of-data-set (EODAD) routine is given control if the end
of the
data set is reached. The data set can be closed if processing is completed,
or an ESETL macro must be issued before a SETL macro to continue further
input processing.
- The error analysis (SYNAD) routine is given control if the input
operation could not be completed successfully. The contents of the
general registers when control is given to the SYNAD user exit routine
are described in z/OS DFSMS Using Data Sets.
- When the key of an unblocked record is retrieved with the data,
the address of the key is returned as follows (see the SETL macro):
Locate Mode: The address of the key is returned in register
0.
Move Mode: The key appears before the record in
your buffer area.
- If a GET macro is issued for a data set and the previous request
issued for the same data set was an OPEN, ESETL, or unsuccessful SETL
(no record found), a SETL B (key and data) is invoked automatically,
and the first record in the data set is returned.