Yes, allocate an internal reader file and write the JCL to that file
//SUBJCL DD SYSOUT=(A,INTRDR)
SELECT SUBJCL-FILE ASSIGN TO SUBJCL.
........
FD SUBJCL-FILE RECORDING MODE IS F BLOCK CONTAINS 0 RECORDS. 01 SUBJCL-REC PIC X(80).
.......
OPEN OUTPUT SUBJCL-FILE.
MOVE JCL-LINE1 TO SUBJCL-REC.
WRITE SUBJCL-REC.
MOVE JCL-LINE2 TO SUBJCL-REC.
.........
CLOSE SUBJCL-FILE.
Click the +1 button below to share it with your friends and colleagues
Disclaimer
FORUM LIST
MAINFRAME-JOBS
COBOL FORUM
JCL FORUM
DB2 FORUM
CICS FORUM
TOOLS FORUM
LOGIN
LOGOUT
MANUALS
ALL-POSTS
Yes, allocate an internal reader file and write the JCL to that file
//SUBJCL DD SYSOUT=(A,INTRDR)
SELECT SUBJCL-FILE ASSIGN TO SUBJCL.
........
FD SUBJCL-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS.
01 SUBJCL-REC PIC X(80).
.......
OPEN OUTPUT SUBJCL-FILE.
MOVE JCL-LINE1 TO SUBJCL-REC.
WRITE SUBJCL-REC.
MOVE JCL-LINE2 TO SUBJCL-REC.
WRITE SUBJCL-REC.
.........
CLOSE SUBJCL-FILE.