COBOL TO RECEIVE DATA FROM JCL

The following COBOL program illustrates how to receive data from JCL in a COBOL program

            05 PARM-LENGTH                  PIC S9(4) COMP.                      PROCEDURE DIVISION USING INPUT-PARM.       * COBOL PROGRAM TO USE DATA RECEIVED FROM JCL              DISPLAY ‘DATA RECEIVED FROM JCL     :’ PARM-DATA.              DISPLAY ‘LENGTH OF DATA FROM JCL    :’ PARM-LENGTH.

Sample JCL to run the above program is as below

//TEST       JOB (ACCINFO,,,,,XXXX),’         ‘,CLASS=M, //            MSGCLASS=Y,NOTIFY=&SYSUID //STEP0010 EXEC PGM=LPGM048,PARM=’INPUT-PARM-HERE’

The output of the program is 

DATA RECEIVED FROM JCL     :INPUT-PARM-HERE                                                                               LENGTH OF DATA FROM JCL    :+00015                                                                                       

; ; ; ;