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


Writing a UNIX File with BSAM or QSAM

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

About this task

You can create a UNIX file with BSAM or QSAM. The application program sees the file as a single-volume, sequential data set that resides on DASD. Because UNIX files are not actually stored as sequential data sets, the system cannot simulate all the characteristics of a sequential data set. For this reason, certain macros and services have incompatibilities or restrictions when they manage UNIX files.

Perform the following steps to create the UNIX file and its directory, write the records to the file, and create an entry in the directory:

Procedure

  1. Code DSORG=PS or DSORG=PSU in the DCB macro._______________________________________________________________

  2. In the DD statement, specify that the data be stored as a member of a new UNIX directory. Specify PATH=pathname and PATHDISP=(KEEP,DELETE) in the DD statement. For an example of creating a UNIX file or directory, see Creating z/OS UNIX Files. _______________________________________________________________
  3. Process the UNIX file 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. _______________________________________________________________

Results

Figure 1 shows an example of creating a UNIX file with QSAM. You can use BSAM, QSAM, BPAM, or UNIX System Services to read this new UNIX file.

Figure 1. Creating a UNIX File with QSAM
   //PDSDD  DD    PATH='pathname',PATHDISP=(KEEP,DELETE), ... 
            ...
            OPEN  (OUTDCB,(OUTPUT))
            ...
            PUT   OUTDCB,OUTAREA     Write record to file
            ...
            CLOSE (OUTDCB)           
            ...
   OUTAREA  DS    CL80               Area to write from
   OUTDCB   DCB   ---,DSORG=PS,DDNAME=PDSDD,MACRF=PM

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014