Writing JCL to compile programs

If the cataloged procedures do not provide you with the flexibility that you need for more complex programs, write your own job control statements. The following example shows the general format of JCL used to compile a program.


//jobname  JOB  acctno,name,MSGCLASS=1                (1)
//stepname EXEC PGM=IGYCRCTL,PARM=(options)           (2)
//STEPLIB  DD   DSNAME=IGY.V6R2M0.SIGYCOMP,DISP=SHR   (3)
//         DD   DSNAME=SYS1.SCEERUN,DISP=SHR
//         DD   DSNAME=SYS1.SCEERUN2,DISP=SHR
//SYSUT1   DD   UNIT=SYSALLDA,SPACE=(subparms)        (4)
//SYSUT2   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT3   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT4   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT5   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT6   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT7   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT8   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT9   DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT10  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT11  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT12  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT13  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT14  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSUT15  DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSMDECK DD   UNIT=SYSALLDA,SPACE=(subparms)
//SYSPRINT DD   SYSOUT=A                              (5)
//SYSLIN   DD   DSNAME=MYPROG,UNIT=SYSALLDA,          (6)
//              DISP=(MOD,PASS),SPACE=(subparms)
//SYSIN    DD   DSNAME=dsname,UNIT=device,            (7)
                VOLUME=(subparms),DISP=SHR
(1)
The JOB statement indicates the beginning of a job.
(2)
The EXEC statement specifies that the Enterprise COBOL compiler (IGYCRCTL) is to be invoked.
(3)
This DD statement defines the data set where the Enterprise COBOL compiler resides.
The Language Environment® SCEERUN and SCEERUN2 data sets must be included in the concatenation (together with the compiler SIGYCOMP data set), unless the Language Environment data sets are available in the LNKLST.
(4)
The SYSUT DD statements define the utility data sets that the compiler will use to process the source program. All SYSUT files must be on direct-access storage devices.
(5)
The SYSPRINT DD statement defines the data set that receives output from compiler options such as LIST and MAP. SYSOUT=A is the standard designation for data sets whose destination is the system output device.
(6)
The SYSLIN DD statement defines the data set (the object module) that receives output from the OBJECT compiler option.
(7)
The SYSIN DD statement defines the data set (source code) to be used as input to the job step.

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 for the following data sets:

  • Sources files
  • Object files
  • Listings
  • ADATA files
  • Debug files
  • Executable modules

However, the compiler utility files (DD statements SYSUTx) and COPY libraries (DD statement SYSLIB) must be MVS data sets.

Start of changeFor more examples about the cataloged procedures in JCL, refer to Using a cataloged procedure and its following topics.End of change