Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Compiling multiple programs (batch compilation)

You can compile a sequence of separate COBOL programs by using a single invocation of the compiler. You can link the object program produced from this compilation into one load module or separate load modules, controlled by the NAME compiler option.

When you compile several programs as part of a batch job, you need to:

To create separate load modules, precede each set of modules with the NAME compiler option. When the compiler encounters the NAME option, the first program in the sequence and all subsequent programs until the next NAME compiler option is encountered are link-edited into a single load module. Then each successive program that is compiled with the NAME option is included in a separate load module.

Use the END PROGRAM marker to terminate each program in the sequence except the last program in the batch (for which the END PROGRAM marker is optional). Alternatively, you can precede each program in the sequence with a CBL or PROCESS statement.

If you omit the END PROGRAM marker from a program (other than the last program in a sequence of separate programs), the next program in the sequence will be nested in the preceding program. An error can occur in either of the following situations:

Example: batch compilation

related references  
NAME


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)