JCL COBOL Submission

How to submit JCL from COBOL program?

Questions by vikaswagh

Showing Answers 1 - 1 of 1 Answers

tag_tushar

  • Aug 26th, 2010
 

Name of Jcl to be submitted by COBOL program: ABC.XYZ.JCL1

COBOL program Name: JCLCOB

ID DIVISION.
PROGRAM-ID. 'JCL-COBOL'.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT INFILE ASSIGN TO DD1
    FILE STATUS IS JC.
DATA DIVISION.
FILE SECTION.
FD INFILE.
01 INREC.
    02 INP PIC X(80).
WORKING-STORAGE SECTION.
01 JC PIC X(2).
PROCEDURE DIVISION.
    OPEN EXTEND INFILE.
    MOVE "//JOB1 JOB NOTIFY=&SYSUID,PRTY=15" TO INP.
    WRITE INREC.
    MOVE "//STEP1 EXEC PGM=IEFBR14" TO INP.
    WRITE INREC.
    MOVE "//SYSPRINT DD SYSOUT=*" TO INP.
    WRITE INREC.
    MOVE "//DD1 DD DSN= ABC.XYZ.JCL1,DISP=SHR" TO INP.
    WRITE INREC.
    MOVE "//DD2 DD SYSOUT=(*,INTRDR)" TO INP.
    WRITE INREC.
    MOVE "//SYSIN DD DUMMY" TO INP.
    WRITE INREC.
    CLOSE INFILE.
    STOP RUN.

COBOBL compiler & link-eiditor:
//JOB1 JOB NOTIFYT=&SYSUID,PRTY=15
//CLER JCLLIB ORDER=XXX.XXX.XXX       <----REPLACE THIS BY YOUR SYSTEM LIBRARY
//COMILE.SYSIN DD DSN=ABC.XYZ.COBOL(JCLCOB),DISP=SHR
//LKED.SYSLMOD DD DSN=ABC.XYZ.LOADLIB(JCLCOB),DISP=SHR
/*
This will create the load module named (JCLCOB)

Now after compiling & link-editing process submit this Jcl to execute the COBOL porgram:
// JOB1 JOB NOTIFY=&SYSUID,PRTY=15
//RUN EXEC PGM=JCLCOB
//STEPLIB DD DSN=ABC.XYZ.LOADLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//DD1 DD SYSOUT=(*,INTRDR)
//SYSIN DD DUMMY
/*
Upon submition of the above program, ABC.XYZ.JCL1 will be executed.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions