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


Example 2: recording RBAs when loading a KSDS

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

In this example, a PUT macro is used to record the RBAs of records as they are loaded into a key-sequenced data set. The RBAs are recorded in a table with 20-byte entries (4 bytes for RBA, 15 bytes for associated key, and 1 byte of padding so the next entry begins on a fullword boundary).
        LA     3,RBATBLE        Address of the beginning of the table.
        ...
LOOP    L      2,source         Put length of record to be inserted    x
                                into register 2.
 
        MODCB  RPL=LIST,        Indicate record length in request      x
               RECLEN=(2)       parameter list.
 
        LTR    15,15
        BNZ    CHECKO
        PUT    RPL=LIST
        LTR    15,15
        BNZ    ERROR
 
        SHOWCB AREA=(3),        Each SHOWCB puts a record's RBA into   x
               FIELDS=RBA,      the table.                             x
               LENGTH=4,                                               x
               RPL=LIST
 
        LTR    15,15
        BNZ    CHECKO
        MVC    4(15,3),         Put the record's key field in the      x
               keyfield         table.
 
        LA     3,20(3)          Point to the next entry.
        B      LOOP
ERROR   ...                     Request was not accepted, or failed.
 
CHECKO  ...                     Modification or display failed.
        .
        DSECT                   Get enough virtual storage for as many x
                                table entries as there are records in  x
                                the data set.
RBATBLE DS     OF
RBA     DS     CL4
KEY     DS     CL15
        DS     CL1              Padding to keep each RBA entry on a    x
                                fullword boundary: SHOWCB's            x
                                display area must be on a fullword     x
                                boundary.

The need to process a key-sequenced data set by address is unusual, but by recording the RBA of each record in a key-sequenced data set, you have search arguments for possible processing of the data set by addressed-direct retrieval and by addressed-sequential retrieval using the POINT macro. (You do not need to know RBAs to process a key-sequenced data set by simple addressed-sequential retrieval, since you go from the beginning without any skips.)

You can display the RBA of a record after you issue a GET or a POINT, as well as after you issue a PUT.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014