Example: JCL for compiling in the z/OS UNIX file system

The following job uses procedure IGYWC to compile a COBOL program, demo.cbl, that is located in the z/OS® UNIX file system. The job writes the generated compiler listing demo.lst, object file demo.o, and SYSADATA file demo.adt in the z/OS UNIX file system.


//UNIXDEMO JOB ,
// TIME=(1),MSGLEVEL=(1,1),MSGCLASS=H,CLASS=A,REGION=50M,
// NOTIFY=&SYSUID,USER=&SYSUID
//COMPILE EXEC IGYWC,
// PARM.COBOL='LIST,MAP,RENT,FLAG(I,I),XREF,ADATA'
//SYSPRINT DD PATH='/u/userid/cobol/demo.lst',    (1)
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),              (2)
// PATHMODE=(SIRUSR,SIWUSR),                      (3)
// FILEDATA=TEXT                                  (4)
//SYSLIN DD PATH='/u/userid/cobol/demo.o',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRUSR,SIWUSR)
//SYSADATA DD PATH='/u/userid/cobol/demo.adt',
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),
// PATHMODE=(SIRUSR,SIWUSR)
//SYSIN DD PATH='/u/userid/cobol/demo.cbl',
// PATHOPTS=ORDONLY,
// FILEDATA=TEXT,
// RECFM=F
(1)
PATH specifies the path name of a file in the z/OS UNIX file system.
(2)
PATHOPTS indicates the access for the file (such as read or read-write) and sets the status for the file (such as append, create, or truncate).
(3)
PATHMODE indicates the permissions, or file access attributes, to be set when a file is created.
(4)
FILEDATA specifies whether the data is to be treated as text or as binary.

You can use a mixture of files in the z/OS UNIX file system (PATH='unix-directory-path') and traditional MVS data sets (DSN=mvs-data-set-name) in the compilation DD statements (shown in this example as overrides). However, the compiler utility files (DD statements SYSUTx) and COPY libraries (DD statements SYSLIB) must be MVS data sets.

Related references  
Data sets used by the compiler under z/OS
UNIX System Services Command Reference
MVS JCL Reference