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


Creating a UNIX File Using JCL

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

To create a UNIX file using JCL, follow these steps:

  1. Specify the PATH=pathname parameter on the DD statement instead of using the DSNAME keyword. You might code the following:
    //DD1 DD PATH='/usr/applics/paytime',PATHOPTS=ORDONLY
    The OPEN macro can use the PATH parameter only for DCBs that specify DSORG=PS, DSORG=PO, and for ACBs. You can use the following DCB parameters with the PATH parameter:
    • BLKSIZE
    • LRECL
    • RECFM
    • BUFNO
    • NCP

    Guideline: BLKSIZE, RECFM, and LRECL values are not stored with a UNIX file. If you do not want the default values, you must specify values for these fields in JCL, SVC 99, or TSO/E ALLOCATE, or in the DCB.

    _______________________________________________________________

  2. Specify the FILEDATA parameter to indicate whether the UNIX file consists of text data, binary data, or record data.

    _______________________________________________________________

  3. Specify the PATHMODE parameter to indicate whether the owner, the group, or others can read or write to the file or directory.

    This parameter is similar to the chmod command in UNIX. For example, if you specify PATHMODE=(SIRWXU,SIRGRP) for a file, the owner can read, write, and run the file, and the group can read the file. For more information, see Specifying Security Settings for UNIX Files and Directories.

    _______________________________________________________________

  4. Use the PATHDISP parameter to specify the disposition (such as KEEP or DELETE) for a UNIX file when the job ends normally or abnormally. (You cannot put the DISP parameter in a DD statement that contains a PATH parameter.)

    _______________________________________________________________

  5. Specify the PATHOPTS parameter to specify the file access group and status for the UNIX file. For example, PATHOPTS=(ORDONLY,OCREAT) creates a new read-only data set.

    _______________________________________________________________

  6. Submit the job, or issue the SVC 99 or TSO ALLOCATE command.

    _______________________________________________________________

  7. Issue the ISHELL command in a TSO/E session to confirm that you have successfully created the UNIX file or directory.

    _______________________________________________________________

  8. Use ISPF Option 3.4 to browse the new UNIX file.

    _______________________________________________________________

Result: The ISHELL command displays all the directories and files in a UNIX directory. The new file is empty until you run a program to write data into it.

Example: The following example shows how to create a UNIX file, paytime in the xpm17u01 directory, using JCL. The new directory and file can be any type of UNIX file system (such as HFS, NFS, zFS, or TFS).

//SYSUT2  DD PATH='/sj/sjpl/xsam/xpm17u01/paytime',
//           PATHDISP=(KEEP,DELETE),        Disposition
//           PATHOPTS=(OCREAT,ORDWR),
//           PATHMODE=(SIRUSR,SIWUSR,      Owner can read and write file
//             SIRGRP,SIROTH),             Others can read the file
//           FILEDATA=TEXT                 Removes trailing blanks in the file

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014