GeekInterview.com
Series: Subject:
Question: 10 of 106

JCL COBOL Submission

How to submit JCL from COBOL program?
Asked by: vikaswagh | Member Since Aug-2010 | Asked on: Aug 16th, 2010

View all questions by vikaswagh

Showing Answers 1 - 1 of 1 Answers
tag_tushar

Answered On : Aug 26th, 2010

View all answers by tag_tushar

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.