z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Switching between Members

z/OS DFSMS Using Data Sets
SC23-6855-00

You can use the NOTE, FIND, and POINT macros to switch between PDSE members (process member 1, then process member 2, then continue processing member 1). Information about how to locate the TTR within a member is also shown in Figure 1.

Figure 1. Using NOTE and FIND to Switch Between Members of a Concatenated PDSE
         OPEN    (PODCB,(INPUT))          Open the DSORG=PO DCB
         ...
         BLDL    PODCB,BLDLLIST           Construct directory entry list
         ...
         FIND    PODCB,BLDLTTR1,C         Position to the 1st member
         ...
         READ    DECB1,SF,PODCB,BUFFER1   Read records from 1st member
         ...
         CHECK   DECB1                    Check the read
         ...
         NOTE    PODCB             Note a position within the 1st member
         ST      1,INMEM1          Store the TTR for the position in member 1
         ...
         FIND    PODCB,BLDLTTR2,C         Position to the 2nd member
         ...
         READ    DECBA,SF,PODCB,BUFFER1   Read records from 2nd member
         ...
         CHECK   DECBA                    Check the read
         ...
         FIND    PODCB,BLDLTTR1,C         Position back to 1st member
         ...
         POINT   PODCB,INMEM1,TYPE=REL    Position to within 1st member
         ...
         READ    DECB2,SF,PODCB,BUFFER1   Read records from 1st member
         ...
         CHECK   DECB2                    Check the read
         ...
         CLOSE   PODCB                    Close the DCB
         ...
PODCB    DCB     DSORG=PO,MACRF=(R),NCP=1,DDNAME=PDSEDD,---
*
INMEM1   DS      F
*
BLDLLIST DS      0F                 BLDL parmlist
BLDLFF   DC      H'2'               Number of entries in BLDL list
BLDLLL   DC      H'12'              Length of storage for directory entry
BLDLN1   DC      CL8'MEMBER1'       Member name
BLDLTTR1 DS      CL3                TTR of 1st member
BLDLK1   DS      CL1                Concatenation # of 1st member
BLDLN2   DC      CL8'MEMBER2'       Member name
BLDLTTR2 DS      CL3                TTR of 2nd member
BLDLK2   DS      CL1                Concatenation # of 2st member
*
BUFFER1  DS      ...

This example uses FIND by TTR. Note that when your program resumes reading a member, that member might have been replaced by another program. See Sharing PDSEs.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014