How to Submit JCL from COBOL

Here is the sample logic on how to submit JCL from COBOL module. You need to write JCL steps to output file in the COBOL Program. Then, assign this file to the internal reader of JCL

Here is sample JCL and COBOL module to invoke JCL from COBOL.

Here is more on Internal reader-COBOL and JCL.

How to Submit JCL from COBOL

//dd1 DD sysout=(*,intrdr)  write your JCL to this file.  or 
//MYOUTPUT DD SYSOUT= whatever your internal reader is at your shop.
SELECT MY-OUTPUT-FILE ASSIGN MYOUTPUT.  
FD MY-OUTPUT-FILE
01 OUTPUT-REC PIC X(80).
WORKING-STORAGE.
01 JCL-TABLE.
05 FILLER PIC X(80) VALUE
'//MYJOB JOB etc etc..... WRITE
OUTPUT-REC FROM JCL-CARD (SUB)

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.