How to execute a set of JCL statements from a COBOL program ?

Answers were Sorted based on User's Feedback



How to execute a set of JCL statements from a COBOL program ?..

Answer / satyasivaji.ch

we can do this by SYSOUT=(*,INTRDR),internal reader concept.

Is This Answer Correct ?    7 Yes 0 No

How to execute a set of JCL statements from a COBOL program ?..

Answer / saravanan

using internal reader concept u can

Is This Answer Correct ?    7 Yes 1 No

How to execute a set of JCL statements from a COBOL program ?..

Answer / pradeep

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 ,Columns,00001,00072,
Command
===>, ,Scroll
===>,CSR ,
******,***************************** 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
Command,====>,
,Scroll,*===>,PAGE
------------------------------------------ Lvl 1 Row 1-2/2
Col 1-36&424-466/525
Total Lines, 60 ,Total Pages,0,
------------------------------------------------------------
-------------------
,* ,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:
======================================================

EDIT ,SORT002_J0093409_JCL ,C
olumns,00001,00072,
Command
===>, ,Scroll
===>,CSR ,
******,***************************** 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 ?    5 Yes 0 No

How to execute a set of JCL statements from a COBOL program ?..

Answer / pradeep

Yes, can be very much done. Only thing is that the dataset
which contains this JCL statements should be mapped to the
JCL dd statement with INTRDR

Is This Answer Correct ?    4 Yes 0 No

How to execute a set of JCL statements from a COBOL program ?..

Answer / guest

Using EXEC CICS SPOOL WRITE(var-name) END-EXEC command.
var-name is a COBOL host structure containing JCL statements.

Is This Answer Correct ?    3 Yes 2 No

How to execute a set of JCL statements from a COBOL program ?..

Answer / ram.g

pgm looks gud...but is it possible to have the jcl in input
file rather than creating o/p file in pgm and use the input
file to submit the jcl..by assinging whatever *.intrdr's dd
name to the i/p file...

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More JCL Interview Questions

is there any way to execute more than one proc in the same exec statement at the same time..?

0 Answers  


please could u tell me the difference between SORT, SYNCSORT,CA-SORT, DFSORT,

1 Answers   IBM,


Can anyone tell me the syntax for printing two files at two different destinations in a single step?

3 Answers  


Can a PS file be read in reverse order?If so,how

2 Answers   Syntel,


what is use of dcb parameter in dd statement?

0 Answers   IBM,






What are three parameters you can specify on Job statement as well as on exec stmt ?

1 Answers  


using cursor how can you fetch more than one record into a variable

3 Answers   Syntel,


Can I concatenate various datasets whose organization are different from each other. Lets say I want to cancatenate a PDS file, a PS file, a GDG file etc. Can You do that ?? If yes, how ? is there any separate Utility to do so ???

4 Answers  


How to compare 2 files using File-Aid?

1 Answers   IBM,


What are three major types of JCL statements? What are their functions?

1 Answers  


i have a jcl calling proc which has 10 steps, i want to execute from step5 to step10, where can i code RESTART and COND parameter?

4 Answers   IBM,


Is stepname is a MUST and should be unique also for each JOBSTEP ? or system can supply the stepname for a step which is not given a name by the programmer ?

6 Answers   IBM,


Categories