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


Example 10: addressed-sequential update (ESDS)

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

In this example, GET and PUT macros are used to retrieve and update records in an entry-sequenced data set. The records are variable in length, a maximum of 200 bytes. The lengths of the records are not changed by update (the length of a record can never be changed by addressed access).
ENTRY   ACB    MACRF=(ADR,SEQ,OUT)
 
ADRUPD  RPL    ACB=ENTRY,         UPD indicates update (or deletion).  x
               AREA=WORK,                                              x
               AREALEN=200,                                            x
               OPTCD=(ADR,SEQ,                                         x
        .      SYN,UPD,MVE)
        .
LOOP    GET    RPL=ADRUPD
        LTR    15,15
        BNZ    ERROR
 
        SHOWCB RPL=ADRUPD,        Determine record length.             x
               AREA=RECLEN,                                            x
               FIELDS=RECLEN,                                          x
               LENGTH=4
 
        LTR    15,15
        BNZ    CHECKO
        .
        PUT    RPL=ADRUPD
        LTR    15,15
        BNZ    ERROR
        B      LOOP
ERROR   ...                       Request was not accepted, or failed.
CHECKO  ...                       Display failed.
        .
WORK    DS     CL200              Record-processing work area.
RLNGTH  DS     F                  Display area for length of records.

If you have inactive records in your entry-sequenced data set, you may reuse the space they occupy by retrieving the records for update and restoring a new record in their place.

With a key-sequenced data set, it is not possible to change the length of records by addressed update because the index is not used and VSAM could not split a control interval if required because of changing record length.

Addressed-direct update varies from sequential update in the specification of an RBA for a search argument.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014