Application programming on z/OS
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


COBOL compile procedure

Application programming on z/OS

An example shows a single-step procedure for compiling a source program.

The JCL in Figure 1 executes the IGYWC procedure, which is a single-step procedure for compiling a source program. It produces an object deck that will be stored in the SYSLIN data set, as we can see in Figure 2.

Figure 1. Basic JCL for compiling a COBOL source program inline
//COMP    JOB
//COMPILE EXEC IGYWC
//SYSIN    DD   *
    IDENTIFICATION DIVISION (source program)
.
.
.
/*
//

The SYSIN DD statement indicates the location of the source program. In this case, the asterisk (*) indicates that it is in the same input stream.

For PL/I programs, in addition to the replacement of the source program, the compile EXEC statement should be replaced by:
//compile EXEC IBMZC

The statements shown in Figure 2 make up the IGYWC cataloged procedure used in Figure 1. As mentioned previously, the result of the compilation process, the compiled program, is placed in the data set identified on the SYSLIN DD statement.

Figure 2. Procedure IGYWC - COBOL compile
//IGYWC  PROC LNGPRFX='IGY.V3R2M0',SYSLBLK=3200
//*
//*  COMPILE A COBOL PROGRAM
//*
//*  PARAMETER  DEFAULT VALUE    
//*   SYSLBLK   3200 
//*   LNGPRFX   IGY.V3R2M0
//*
//*  CALLER MUST SUPPLY //COBOL.SYSIN DD . . .
//*
//COBOL  EXEC PGM=IGYCRCTL,REGION=2048K
//STEPLIB  DD  DSNAME=&LNGPRFX..SIGYCOMP, 
//             DISP=SHR
//SYSPRINT DD  SYSOUT=*
//SYSLIN   DD  DSNAME=&&LOADSET,UNIT=SYSDA,
//             DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
//             DCB=(BLKSIZE=&SYSLBLK)
//SYSUT1   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT3   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT4   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT5   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT6   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT7   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))




Copyright IBM Corporation 1990, 2010