Adding Members
To add additional members to the PDS, follow the procedure described in Figure 1. However, a separate DD statement (with the space request omitted) is required for each member. The disposition should be specified as modify (DISP=MOD). The data set must be closed and reopened each time a new member is specified on the DD statement.
You can use the basic partitioned access method (BPAM) to process
more than one member without closing and reopening the data set. Use
the STOW, BLDL, and FIND macros to provide more information with each
directory entry, as follows:
- Request space in the DD statement for the entire data set and the directory.
- Define DSORG=PO or DSORG=POU in the DCB macro.
- Use WRITE and CHECK to write and check the member records.
- Use NOTE to note the location of any note list written within the member, if there is a note list, or to note the location of any subgroups. A note list is used to point to the beginning of each subgroup in a member.
- 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. The STOW macro writes an end-of-file mark after the member.
- Continue to use the WRITE, CHECK, NOTE, and STOW macros until all the members of the data set and the directory entries have been written.
Figure 1 shows an example of using STOW to create members of a PDS.
//PDSDD DD ---,DSN=MASTFILE,DISP=MOD,SPACE=(TRK,(100,5,7))
...
OPEN (OUTDCB,(OUTPUT))
LA STOWREG,STOWLIST Load address of STOW list
...
** WRITE MEMBER RECORDS AND NOTE LIST
MEMBER WRITE DECBX,SF,OUTDCB,OUTAREA WRITE first record of member
CHECK DECBX
LA NOTEREG,NOTELIST Load address of NOTE list
*
WRITE DECBY,SF,OUTDCB,OUTAREA WRITE and CHECK next record
CHECK DECBY
*
NOTE OUTDCB To divide the member into subgroups,
ST R1,0(NOTEREG) NOTE the TTRN of the first record in
* the subgroup, storing it in the NOTE list.
LA NOTEREG,4(NOTEREG) Increment to next NOTE list entry
...
WRITE DECBZ,SF,OUTDCB,NOTELIST WRITE NOTE list record at the
* end of the member
CHECK DECBZ
NOTE OUTDCB NOTE TTRN of NOTE list record
ST R1,12(STOWREG) Store TTRN in STOW list
STOW OUTDCB,(STOWREG),A Enter the information in directory
* for this member after all records
* and NOTE lists are written.
LA STOWREG,16(STOWREG) Increment to the next STOW list entry
...
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=PDSDD,MACRF=W
R1 EQU 1 Register one, return register from NOTE
NOTEREG EQU 4 Register to address NOTE list
NOTELIST DS 0F NOTE list
DS F NOTE list entry (4 byte TTRN)
DS 19F one entry per subgroup
STOWREG EQU 5 Register to address STOW list
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'23' C byte, 1 user TTRN, 4 bytes of user data
DS CL4 TTRN of NOTE list
... one list entry per member (16 bytes each)Recommendation: Do not use the example in Figure 1 for PDSEs. If your installation plans to convert PDSs to PDSEs, follow the procedure described in Figure 1.