Batch compilation for COBOL programs
Separate COBOL programs can be compiled together as one input file. An END PROGRAM header statement terminates each program and is optional for the last program in the batch. The translator accepts separate COBOL programs in a single input file, and interprets END PROGRAM header statements.
Translator options specified as parameters when invoking the translator are in effect for the whole batch, but can be overridden for a unit of compilation by options specified in the CBL or PROCESS card that initiates the unit.
- Options fixed as installation non-user-modifiable options.
- Options specified in the CBL or PROCESS card that initiates the unit.
- Options specified when the translator is invoked.
- Default options.
For more information about compilation, see Installing application programs.
- Include the compiler NAME option as a parameter in the JCL statement that invokes the compiler or in a CBL statement for each top-level (non-nested) program. This causes the inclusion of a NAME statement at the end of each program. See Figure 1 for more information.
- Edit the compiler output to add INCLUDE and ORDER statements for the CICS COBOL stub to each object module. These statements cause the linkage editor to include the stub at the start of each load module. These statements can be anywhere in the module, though by convention they are at the start. You might find it convenient to place them at the end of the module, immediately before each NAME statement. Figure 2 shows the output from Figure 1 after editing in this way.
For batch compilation you must vary the procedure described in Installing application programs . The following is a suggested method:
- Split the supplied cataloged procedure DFHYITVL into two procedures: PROC1 containing the translate and compilation steps (TRN and COB), and PROC2 containing the linkage editor steps COPYLINK and LKED.
-
In PROC1, add the NAME option to the parameters in the EXEC
statement
for the compiler, which then looks like this:
//COB EXEC PGM=IGYCRCTL,REGION=.., // PARM='....,NAME,....',
- In
PROC1, change the name and disposition of the compiler output data
set &&LOADSET. At least remove the initial && from
the data
set name and change the disposition to CATLG. The SYSLIN statement
should
then read:
//SYSLIN DD DSN=LOADSET,DISP=(NEW,CATLG), // UNIT=&WORK,SPACE=(80,(250,100))
- Run PROC1.
- Edit the compiler output in the data set LOADSET to add the INCLUDE and ORDER statements as shown in Figure 2. If you use large numbers of programs in batches, you should write a simple program or REXX EXEC to insert the ORDER and INCLUDE statements.
-
In PROC2, add a DD statement for the library that includes the
CICS stub. The standard name of this library is
CICSTS54.CICS
.SDFHLOAD. The INCLUDE statement for the stub refers to this
library by the DD name. In
Figure 2
, it is assumed you have used the DD name SYSLIB ( or concatenated
this library to SYSLIB). The suggested statement is:
//SYSLIB DD DSN= CICSTS54.CICS .SDFHLOAD, // DISP=SHR
-
In PROC2, replace the SYSLIN concatenation with the single
statement:
//SYSLIN DD DSN=LOADSET, // DISP=(OLD,DELETE)
In this statement it is assumed that you have renamed the compiler output data set LOADSET.
- Run PROC2.