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


Example 11: marking records inactive (ESDS)

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

In this example, GET and PUT macros retrieve a record from an entry-sequenced data set and mark it as inactive by putting a hexadecimal X'FF' in the first byte of a record. The inactive record can only be sequentially retrieved for update.
ENTRYSEQ ACB   MACRF=(ADR,DIR,                                         x
               OUT)
 
LIST     RPL   ACB=ENTRYSEQ,      UPD indicates update; storing the    x
               AREA=RECORD,       record back marked inactive.         x
               AREALEN=100,                                            x
               OPTCD=(ADR,DIR,                                         x
               SYN,UPD,MVE),                                           x
         .     ARG=RBAAREA
         .
LOOP     GET   RPL=LIST
         LTR   15,15
         BNZ   ERROR
Decide whether you still want the data in the record.
         BE    LOOP               Yes; retrieve the next record.
 
         MVI   RECORD,X'FF'       No; flag the record inactive.
         PUT   RPL=LIST           For an entry-sequenced data          x
                                  set, storing the record with         x
                                  an inactive indicator is             x
                                  equivalent to  deletion.
         LTR   15,15
         BNZ   ERROR
         B     LOOP
ERROR    ...                      Request was not accepted, or failed.
RECORD   DS    CL100              Work area for marking records.
RBAAREA  DS    F                  Search argument for retrieving record.

You cannot delete an entry-sequenced data set record. You can mark an ESDS record inactive by placing a unique flag in a conventional part of the record so that when the record is subsequently retrieved, the flag causes the record to be bypassed. To reuse the space occupied by an inactive ESDS record, retrieve it for update and store a new record in its place.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014