How to execute a set of JCL statements from a COBOL program ?
Answers were Sorted based on User's Feedback
Answer / satyasivaji.ch
we can do this by SYSOUT=(*,INTRDR),internal reader concept.
Is This Answer Correct ? | 7 Yes | 0 No |
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 |
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 |
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 |
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 |
what is XSUM in some fields= none, xsum ??
Can we have a JOBSTEP without any EXEC ?
How are GDGs concatenated?
Explain about LMFREE�free data set from its association with data ID
How I sort the records in a file and copy the first 10 records to another file
How to execute step2,step1, step3 if step1,2,3 are in order
wht is the d/f between positional parameter n keyword parameter ?
i have a jcl in which 4 & 5 step creates a new generation. 4th step output is as input for the 6th step & 5th step output is used as input in the 7th step. How they are refered as in the 6th & 7th steps? If the job abends in 6th step then how the 5th step output is refered in 7th step?
Describe the EXEC statement, its meaning, syntax and keywords?
I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPRO 3 WIPRO 2 WIPRO 9 TCS 4 TCS 6 TCS 3 i want the record of every company with highest code How can i do that?
What is a MODEL Paramater in GDG ?
What is a Proc ? why do we go for a Proc ? What are the types of procs?Can we have nesting in Procs ?