z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


TRUNC—Truncate an Output Buffer

z/OS DFSMS Using Data Sets
SC23-6855-00

When using QSAM to write blocked records, you can issue the TRUNC macro to direct the system to write a short block. The first record in the next buffer is the next record processed by a PUT-output or a PUTX-output mode.

If the locate mode is being used, the system assumes a record has been placed in the buffer segment pointed to by the last PUT macro.

The last block of a data set is truncated by the CLOSE routine. A data set that contains format-F records with truncated blocks generally cannot be read as efficiently as a standard format-F data set.

A TRUNC macro issued against a PDSE does not create a short block because the block boundaries are not saved on output. On input, the system uses the block size specified in the DCB or DCBE for reading the PDSE. Logical records are packed into the user buffer without respect to the block size specified when the PDSE member was created.

To help the storage administrator find programs that issue a QSAM TRUNC macro for PDSEs, the SMF type 15 record (see z/OS MVS System Management Facilities (SMF)) contains an indicator that the program did it.

Recommendation: Avoid using the QSAM TRUNC macro. Many data set copying and backup programs reblock the records. This means they do not preserve the block boundaries that your program can have set.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014