Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you submit JCL via a Cobol program?

Answer Posted / abhinandan

Below is explanation with example:-

THE BELOW GIVEN IS AN EXAMPLE OF HOW TO SUBMIT A JCL FROM A
COBOL PGM:
============================================================
============

COBOL CODE WHICH HAS THE JCL STATEMENTS:
=========================================

IDENTIFICATION DIVISION.
PROGRAM-ID. PROG55.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-FILE ASSIGN DDFILE1
ORGANIZATION IS SEQUENTIAL
FILE STATUS IS IN-STATUS.
DATA DIVISION.
FILE SECTION.
FD IN-FILE.
01 IN-REC PIC X(80).
WORKING-STORAGE SECTION.
01 IN-STATUS PIC X(2).
PROCEDURE DIVISION.

OPEN OUTPUT IN-FILE.
DISPLAY IN-STATUS.

MOVE '//SORT002 JOB MSGCLASS=X,CLASS=T,' TO IN-
REC.
WRITE IN-REC.

MOVE '// MSGLEVEL=(1,1),NOTIFY=XXXXX'
TO IN-
REC.
WRITE IN-REC.

MOVE '//STEPDEF EXEC PGM=IEFBR14' TO IN-
REC.
WRITE IN-REC.

MOVE '//DATA1 DD DSN=TNL.PV.INTRDR.SAMF,DISP=
(NEW,CATLG),'
TO IN-
REC.
WRITE IN-REC.
MOVE '// LRECL=80' TO IN-
REC

WRITE IN-REC.

DISPLAY IN-STATUS.
CLOSE IN-FILE.
STOP RUN.


THIS IS THE JCL TO RUN THE ABOVE COBOL PGM 'PROG55' FROM
ENDEVOR LIBRARY.

Note: '//DDFILE1 DD SYSOUT=(*,INTRDR)' USED BELOW.

ALSO THE DDFILE1 IS USED AS THE DD NAME IN THE ABOVE COBOL
PGM
============================================================
===============

EDIT ,xxxxx.GENERAL.JCL(INTR1) - 01.03
******,***************************** Top of Data
******************************
000001,//XXXXX98 JOB CLASS=A,
000002,// MSGCLASS=X,TIME=NOLIMIT,
000003,// NOTIFY=&SYSUID,
000004,// MSGLEVEL=(1,1)
000005,//STEP0010 EXEC PGM=PROG55
000006,//DDFILE1 DD SYSOUT=(*,INTRDR)
000007,//SYSPRINT DD SYSOUT=*
000008,//SYSUDUMP DD SYSOUT=*
000009,//STEPLIB DD DSN=PMI.CR.SUPT.LOADLIB,DISP=SHR
000010,//SYSIN DD DUMMY
******,**************************** Bottom of Data
****************************



THIS IS THE JOB THAT IS CREATED & SUBMITTED BY THE COBOL
PGM:
============================================================
===

SYSVIEW ISPF1 RCEM --------------,Job Queues,-------
26Jan08 11:08:50
,* ,ALL, ,ALL ,ALL ,
Cmd Jobname Type Jobnr Queue Stat|
CCode
,SORT002 JOB 93409 OUTP
HLDC,..................... 0,
********************************* End of Data
*********************************



THIS NEW JCL CONTAINS THE BELOW GIVEN JCL STATEMENTS:
======================================================

******,***************************** Top of Data
******************************
000001,//SORT002 JOB MSGCLASS=X,CLASS=T,
000002,// MSGLEVEL=(1,1),NOTIFY=XXXXX
000003,//* $ACFJ219 ACF2 ACTIVE RCEMP1
000004,//STEPDEF EXEC PGM=IEFBR14
000005,//DATA1 DD DSN=TNL.PV.INTRDR.SAMF,DISP=(NEW,CATLG),
000006,// LRECL=80
******,**************************** Bottom of Data
****************************

Is This Answer Correct ?    18 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

1165


How can an in-stream dataset be terminated?

1289


In job processing, what happens in conversion stage?

1146


in order to execute step2 a job after a return code of 8 in step1, what condition you will code in step2?

2642


What do you understand by the terms: joblib and steplib?

1104


Explain the function of a dd statement?

1123


Can we call instream to catalog and catalog to instream?

1086


What are the parameters that are used in creating a gdg?

1149


What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?

2463


What are the utility programs in jcl?

1097


what is use of disp parameter in dd statement?

1045


Explain the jcl exec statement?

1084


Explain the hierarchy levels in jcl?

1629


What is jcl in mainframe?

1140


How to pass data to a program that is coded in an exec statement?

1267