COBOL considerations

To run COBOL programs in more than one task with Language Environment, the COBOL programs must be Enterprise COBOL for z/OS, COBOL for OS/390 & VM, COBOL for MVS & VM, or COBOL/370. Running VS COBOL II programs in more than one task is not supported. When you use COBOL programs in more than one task, it is recommended that the COBOL programs be compiled with the RENT compiler option, and that the load modules be linked as REUS and RENT.

If a COBOL program running in one task dynamically calls a COBOL program that has already been dynamically called from another task, then the called program must be:
  • Compiled with the RENT compiler option, or
  • Compiled with the NORENT compiler option and link-edited with the NORENT and NOREUS linkage editor options.
Each copy of a COBOL program in each task will have its own unique copy of WORKING-STORAGE; you cannot share WORKING-STORAGE between tasks.
For example (see Figure 1), if a COBOL program calls an assembler program, which starts a new Subtask B, and COBOL program CBL3 in the new subtask dynamically calls COBOL program CBL2 which was previously dynamically called in the main task, then CBL2 must not be link-edited with the RENT or REUS link-edit options unless it is compiled with the RENT compiler option.
Figure 1. A dynamically-called COBOL program that dynamically calls another COBOL program
                   MAIN     .
                   task     .  Subtask B
                            .
                   CBL1     .
                    |       .
                    V       .
                   CBL2 <---.------------
                    |       .            |
                    V       .            |
                   ASMA----(attach)---->CBL3