Passing Data From JCL to COBOL

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

“The greatest glory in living lies not in never falling, but in rising every time we fall.”

Nelson Mandela

3. Sample COBOL 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 tests that if string-len is greater than zero, we can validate the data from JCL.

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.