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


CHECK—Wait for completion of a request (BDAM, BISAM, BPAM, and BSAM)

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

The CHECK macro places the active task in the wait condition, if necessary, until the associated input or output operation is completed. The input or output operation is then tested for errors and exceptional conditions. If the operation completes successfully, control is returned to the instruction following the CHECK macro. If the operation does not complete successfully, the error analysis (SYNAD) routine or end-of-data (EODAD) routine is given control. If the appropriate routine is not provided, the task is abnormally terminated. These routines are discussed in the SYNAD and EODAD parameters of the DCB and DCBE macros.

The following conditions are also handled for BPAM and BSAM only:

When Reading: The end-of-data (EODAD) routine is given control if an input request is made after all the records are retrieved. Volume switching is automatic for a multivolume data set not opened for UPDAT. For a multivolume data set opened for UPDAT, the end-of-data routine is entered at the end of each volume. The system treats a striped data set as a single volume.

When Writing:Additional space on the device is obtained when the current space is filled and more WRITE macros have been issued.

When writing on a cartridge tape, CHECK ensures that the data has been transferred to the tape subsystem and not necessarily to tape. To ensure that all of the data is on the tape, issue either a CLOSE macro or a SYNCDEV macro with INQ=NO. However, SYNCDEV generally is not useful and gives poor performance. Without SYNCDEV, if any data fails to get on the tape, a subsequent CHECK macro or CLOSE macro will detect and handle the I/O error.

You must issue a CHECK, WAIT, or EVENTS macro for each input and output operation. For BSAM and BPAM, the CHECK, WAIT, or EVENTS macros must be issued in the same order as the READ or WRITE macros were issued for the data set. For information on when you can use the WAIT or EVENTS macro, see z/OS DFSMS Using Data Sets.

Processing PDSEs: If a PDSE member is open for update and in a storage class with "Guaranteed Synchronous Write" specified, a CHECK macro issued following a WRITE macro guarantees that the data is synchronized to DASD. Otherwise, synchronization is not guaranteed until CLOSE, or the STOW macro or the SYNCDEV macro is issued. Specifying "Guaranteed Synchronous Write" in the storage class produces the same result as issuing the SYNCDEV macro after every CHECK. On output, CHECK guarantees that the ECB is posted and that the data has been moved from your buffer into an internal system buffer, allowing your buffer to be available for reuse.

Processing UNIX files: CHECK guarantees that the ECB is posted and that any output data has been moved from your buffer to an internal system buffer, allowing your buffer to be available for reuse.

CHECK does not necessarily guarantee that the output data has been synchronized to the output file, unless PATHOPTS=OSYNC is specified. If PATHOPTS=OSYNC is specified, CHECK guarantees that the output data has been synchronized to the output file. Issuing the CLOSE or the SYNCDEV macro guarantees that all output data has been synchronized to the output file.

Processing Compressed Format Data Sets: When processing a compressed format data set on output, CHECK guarantees that the ECB is posted and that the data has been moved from your buffer into an internal system buffer, allowing your buffer to be available for reuse. CHECK does not guarantee that the data is synchronized to DASD. Synchronization is not guaranteed until CLOSE or the SYNCDEV macro is issued. Specifying "Guaranteed Synchronous Write" in the storage class produces the same result as issuing the SYNCDEV macro after every CHECK.

Data Conversion: You can request conversion by coding LABEL=(,AL) or (,AUL) in the DD statement, or by coding OPTCD=Q in the DCB macro or DCB subparameter of the DD statement. If conversion is requested, the check routine automatically converts BSAM records, as they are read, from one character representation to another if the record format is F, FB, D, DB, or U. Conversion occurs when the check routine determines that the input buffer is full. Conversion is performed according to one of the following techniques:
  • Coded Character Set Identifier (CCSID) Conversion. If CCSIDs are supplied from any source1 for ISO/ANSI V4 tapes, records are converted between the CCSID which represents the data on tape and the CCSID as seen by the problem program. You can also prevent conversion by supplying a special CCSID.
  • Default Character Conversion. If you are using non-ISO/ANSI V4 tapes or if CCSIDs are not supplied by any source, data management converts the records between ASCII code and EBCDIC code using specific tables defined for this default character conversion.

Refer to z/OS DFSMS Using Data Sets for a complete description of CCSID conversion and default character conversion.

After you issue a CHECK macro when reading format D or DB blocks without BUFUFFEL, the length of the block is in the DCB LRECL field in the DCB. It will remain valid until the next CHECK macro.

The CHECK 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 CHECK macro is:

decb address—RX-Type Address, (2-12), or (1)
specifies the address of the data event control block created or used by the associated READ or WRITE macro. When issued in 31-bit addressing mode, the input DECB address must be a clean 31-bit address. If your SYNAD or EODAD routine is entered, it is entered in the addressing mode in which the CHECK was issued. If you supplied a SYNAD or EODAD routine which resides above the line in the DCBE, then the CHECK must be issued in 31-bit addressing mode.
DSORG={IS|ALL}
specifies the type of data set organization. You can specify:
IS
specifies that the macro expansion is for BISAM use only.
ALL
specifies that the macro expansion is for BDAM, BISAM, BPAM, or BSAM use.

If DSORG is omitted, the macro expansion is for BDAM, BPAM, or BSAM use only.

1 CCSID may be supplied in the CCSID subparameter of a JOB, EXEC, or DD statement or the tape label.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014