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


Example: TESTCB macro (test for data set attributes)

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

In this example, a TESTCB macro is used to determine whether a data set is a key sequenced or an ESDS.
LIST    RPL
        .
        SHOWCB AREA=DATAFCT,                                           x
               FIELDS=ACB,                                             x
               LENGTH=4,                                               x
               RPL=LIST
 
        LTR    15,15
        BNZ    CHECKO
 
        TESTCB ACB=(*,           Is the data set key sequenced?       x
               DATAFCT),                                              x
               ATRB=KSDS,                                             x
               ERET=CHECKO
 
        BE     KEYSEQ            Yes.
        .
KEYSEQ  ...                      Data set is key sequenced.
 
CHECKO  ...                      Display or test failed.
        .
DATAFCT DS     F                 For displaying address of access     x
                                 method control block.
The SHOWCB macro's parameters are:
  • AREA and LENGTH specify a 4-byte area, DATAFCT, aligned on a fullword boundary, used for the display.
  • FIELDS and RPL specify the address of the access method control block in the LIST request parameter list to be displayed.
The TESTCB macro's parameters are:
  • ACB specifies that a field in the access method control block, the address of which is located at DATAFCT, is to be tested. The SHOWCB macro put the address of the access method control block at DATAFCT.
  • ATRB specifies that the access method control block is to be tested to determine whether it is a KSDS.
  • ERET specifies that a routine named CHECK0 is to be given control if an error occurs that makes it impossible to make the test.

There is no need to examine the feedback field in an EODAD routine. It can be assumed to contain the end-of-data-set indication.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014