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:
- Code DSORG=PO in the DCB macro.
- Use WRITE and CHECK to write and check the member records.
- 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.
- 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.