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


Adding or Replacing PDSE Members Serially

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

To add additional members to the data set or replace members, follow the procedure described in Figure 1. However a separate DD statement omitting the space request is required for each member. Specify the disposition as old or shared (DISP=OLD or SHR). You can process more than one member without closing and reopening the data set, as follows:

  1. Code DSORG=PO in the DCB macro.
  2. Use WRITE and CHECK to write and check the member records.
  3. When all the member records have been written, issue a STOW macro to enter the member name, its location pointer, and any additional data in the directory.
  4. Continue to use WRITE, CHECK, and STOW until all the members of the data set and the directory entries have been written.

The example in Figure 1 shows how to process more than one PDSE or PDS member without closing and reopening the data set.

Figure 1. Adding PDSE Members Serially
   //PDSEDD DD    ---,DSN=MASTFILE,DISP=MOD,SPACE=(TRK,(100,5,7))
            ...
            OPEN  (OUTDCB,(OUTPUT))
            ...
   **   WRITE MEMBER RECORDS

   MEMBER   WRITE DECBX,SF,OUTDCB,OUTAREA  WRITE first record of member
            CHECK DECBX
   *
            WRITE DECBY,SF,OUTDCB,OUTAREA  WRITE and CHECK next record
            CHECK DECBY
            ...                           WRITE/CHECK remaining records of member
   *
            STOW  OUTDCB,STOWLIST,A       Enter the information in directory
   *        ...                           for this member after writing all records
Repeat from label "MEMBER" for each additional member, changing the
member name in the "STOWLIST" for each member.
            ...
            CLOSE (OUTDCB)                (NO automatic STOW)
            ...
   OUTAREA  DS    CL80                    Area to write from
   OUTDCB   DCB   ---,DSORG=PO,DDNAME=PDSEDD,MACRF=W
   STOWLIST DS    0F                      List of member names for STOW
            DC    CL8'MEMBERA'            Name of member
            DS    CL3                     TTR of first record (created by STOW)
            DC    X'00'                   C byte, no user TTRNs, no user data

The A option on STOW in Figure 1 means the members did not exist before. You can code R to replace or all members.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014