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


Creating a PDS Member with BSAM or QSAM

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

If you have no need for your program to add entries to the directory (the STOW macro is not used), you can write a member of a PDS, such as the one in Figure 1.

The following steps create the data set and its directory, write the records of the member, and make a 12-byte entry in the directory:

  1. Code DSORG=PS or DSORG=PSU in the DCB macro.
  2. In the DD statement specify that the data is to be stored as a member of a new PDS, that is, DSNAME=name(membername) and DISP=NEW.
  3. Optionally specify a data class in the DD statement or let the ACS routines assign a data class.
  4. Use the SPACE parameter to request space for the member and the directory in the DD statement, or obtain the space from the data class.
  5. Process the member with an OPEN macro, a series of PUT or WRITE macros, and the CLOSE macro. A STOW macro is issued automatically when the data set is closed.
Figure 1. Creating One Member of a PDS
   //PDSDD  DD    ---,DSNAME=MASTFILE(MEMBERK),SPACE=(TRK,(100,5,7)),
   //             DISP=(NEW,CATLG),DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)---
            ...
            OPEN  (OUTDCB,(OUTPUT))
            ...
            PUT   OUTDCB,OUTAREA     Write record to member
            ...
            CLOSE (OUTDCB)           Automatic STOW
            ...
   OUTAREA  DS    CL80               Area to write from
   OUTDCB   DCB   ---,DSORG=PS,DDNAME=PDSDD,MACRF=PM

If the preceding conditions are true but you code DSORG=PO (to use BPAM) and your last operation on the DCB before CLOSE is a STOW macro, CLOSE does not issue the STOW macro.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014