Passing data from JCL to COBOL
Created at Canava

Here are the ideas to pass data from JCL to COBOL. I have explained in three steps.

1. How Many Ways You Can Pass Data

  • From JCL we can pass data into COBOL program two ways.
  • One is through PARM (maximum limit is 100 bytes), second through Input file, third through SYSIN card.

2. How to Pass Data From JCL

3. Accessing JCL parameters in COBOL: Sample logic

LINKAGE SECTION.

01 PARMDATA.
05 STRINGLEN PIC 9(4) USAGE COMP.
05 STRINGPARM PIC X(80).
PROCEDURE DIVISION USING PARMDATA.
IF STRINGLEN > 0 . . .

The logic checks if string-len is greater than zero, so we can validate the parameters from the JCL.

Write your answer here:

Go back

Your message has been sent

Warning
Warning
Warning
Warning.