z/OS DFSMS Macro Instructions for Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


PUT—Write next record (QISAM interface to VSAM)

z/OS DFSMS Macro Instructions for Data Sets
SC23-6852-02

The PUT macro writes a record into an indexed sequential data set. If the move mode is used, the PUT macro moves a logical record into an output buffer from which it is written. If locate mode is specified, the address of the next available output buffer segment is available in register 1 after the PUT macro is executed. The logical record can then be constructed in the buffer for output as the next record.

The records are blocked by the system (if specified in the data control block) before being placed in the data set. The system uses the length specified in the record length (DCBLRECL) field of the data control block as the length of the record currently being written.When constructing blocked variable-length records in the locate mode, the problem program might either specify the maximum record length once in the DCBLRECL field of the data control block or provide the actual record length in the DCBLRECL field before issuing each PUT macro. Using the maximum record length may result in more but shorter blocks, because the system uses this length when it tests to see if the next record can be contained in the current block.

The PUT macro is used to write a new indexed sequential data set or extend it.To extend the data set, the key of any added record must be higher than the highest key existing in the data set, and the disposition parameter of the DD statement must be specified as DISP=MOD. The new records are placed in the prime data space, starting in the first available space, until the original space allocation is exhausted.

To allocate a data set using previously allocated space, the disposition parameter of the DD statement must specify DISP=OLD.

For QISAM, interface to VSAM PUT must be issued in 24-bit mode.

Recommendation: The system no longer supports indexed sequential data sets. Convert the data set to a key sequenced data set (KSDS) and use the ISAM interface of VSAM or convert your program to use VSAM.

The format of the PUT macro is:

dcb address—RX-Type Address, (2-12), or (1)
specifies the address of the data control block for the opened indexed sequential data set.
area address—RX-Type Address, (2-12), or (0)
specifies the address of the area containing the record to be written (move mode only). Either move or locate mode can be used with QISAM interface to VSAM, but they must not be mixed in the specified data control block. The following describes operations for locate and move 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 next available buffer in register 1. This is the buffer into which you should move the next record. The record is not written until another PUT macro is issued for the same data control block or a CLOSE macro is issued to close the data set.

Move Mode: If move mode has been specified in the data control block, the area address must specify the address in the problem program that contains the record to be written.The system moves the record from the area to an output buffer before control is returned. If the area address is omitted, the system assumes that register 0 contains the area address.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014