z/OS DFSMSdfp Advanced Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example

z/OS DFSMSdfp Advanced Services
SC23-6861-01

In the following example, the format-1 DSCB for data set A.B.C is read into virtual storage using the SEARCH option. The serial number of the volume containing the DSCB is 770655.
          OBTAIN    DSCBABC           READ DSCB FOR DATA
*                                     SET A.B.C INTO DATA
*                                     AREA NAMED WORKAREA

DSCBABC   CAMLST    SEARCH,DSABC,VOLNUM,WORKAREA
DSABC     DC        CL44'A.B.C'       DATA SET NAME
VOLNUM    DC        CL6'770655'       VOLUME SERIAL NUMBER
WORKAREA  DS        140C              140-BYTE WORK AREA
Recommendation: Check the return codes.

The OBTAIN macro instruction points to the CAMLST parameter list. SEARCH, the first operand of CAMLST, specifies that a DSCB be read into virtual storage using the data set name at the address indicated in the second operand. DSABC specifies the virtual storage location of a 44-byte area containing the fully-qualified name of the data set whose format-1 DSCB is to be read. VOLNUM specifies the virtual storage location of a 6-byte area in which you have placed the serial number of the volume containing the required DSCB. WORKAREA specifies the virtual storage location of a 140-byte work area into which the DSCB is to be returned.

Control is returned to your program at the next executable instruction following the OBTAIN macro instruction. If the DSCB has been successfully read into your work area, register 15 contains zeros. Otherwise, register 15 contains one of the return codes shown in Table 1.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014