Skip to Content
Custom Search

COBOL TO RECEIVE DATA FROM JCL

 

The following COBOL program illustrates how
to receive data from JCL in a COBOL program
 
 
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PGM048.
       AUTHOR. MAINFRAMEWIZARD.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       LINKAGE SECTION.
 
        01  INPUT-PARM.                                                  
            05 PARM-LENGTH                  PIC S9(4) COMP.              
            05 PARM-DATA                    PIC X(15).                   
       PROCEDURE DIVISION USING INPUT-PARM.
       10000-MAIN-PARA.
 
      * COBOL PROGRAM TO USE DATA RECEIVED FROM JCL
             DISPLAY 'DATA RECEIVED FROM JCL     :' PARM-DATA.
             DISPLAY 'LENGTH OF DATA FROM JCL    :' PARM-LENGTH.
 
       10000-EXIT.
             EXIT.
             STOP RUN.
 
 
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'
//SYSOUT   DD  SYSOUT=*
 
 
 
The output of the program is 
 
 
DATA RECEIVED FROM JCL     :INPUT-PARM-HERE                                                                              
LENGTH OF DATA FROM JCL    :+00015                                                                                       
 
 
 
 
 
 
 
 
 
 
                                                                    
 
 
 
 
 
; ; ; ;

Comments

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 32 guests online.
Dr. Radut | page