TRUNC—Truncate buffer (QSAM output—fixed or variable-length blocked records and BSAM)

For QSAM: The TRUNC macro causes the current output buffer to be regarded as full. The next PUT or PUTX macro specifying the same data control block uses the next buffer to hold the logical record.

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 DCBBLKSI for reading the PDSE.

When a variable-length spanned record is truncated and logical record interface, or extended logical record interface, is specified (that is, if BFTEK=A is specified in the DCB macro, or if a BUILDRCD macro is issued, or if DCBLRECL=0K or nnnnnK is specified), the system segments and writes the record before truncating the buffer. Therefore, the block being truncated is the one containing the last segment of the spanned record.

The TRUNC macro is ignored if it is used for unblocked records, if it is used when a buffer is full, if it is used without an intervening PUT or PUTX macro, or when it is used with UNIX files.

For BSAM on DASD: The TRUNC macro causes any queued READs or WRITEs to be issued although the accumulation limit has not been reached. See the DCBE MULTACC parameter.

The BSAM issuer of TRUNC should ensure that if the DCB address is supplied in a register, it must be a valid 31-bit address even if the issuer is not in 31-bit mode. If the buffers are above the line, TRUNC must be issued in 31-bit mode.

If you issue a TRUNC macro for a DCB for a spooled, tape, dummy, or compressed format data set, it has no effect.

Recommendation: If a WAIT is issued while DCBE MULTACC is specified, it should be preceded by a TRUNC macro because future levels of the system might require it.

Do not issue a TRUNC macro when using BSAM to create a direct (BSAM) data set or with BFTEK=R (when reading a direct data set).

The TRUNC macro may be issued in 24- or 31-bit addressing mode. When issued in 31-bit addressing mode, all addresses must be valid 31-bit addresses.

The format of the TRUNC macro is:

dcb address—RX-Type Address, (2-12), or (1)
specifies the address of the data control block for the sequential data set opened for QSAM output or for BSAM. For QSAM, the record format in the data control block must not indicate standard blocked records (RECFM=FBS). When issued in 31-bit addressing mode, the input DCB address must be a clean 31-bit address.