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 |
Can we write same stepname for one or more steps in on job ?
Can I share my data with other jobs? How?
Explain about LMGET�read a logical record from a data set
what is the meaning of keyword in jcl?what is is opposite?
What do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?
If the proc stepname is excluded while overriding the COND, TIME, REGION and PARM parameters while calling the proc, will the override only apply to the first step in the proc or all the steps for all the above parameters?
how to convert a file form fixed Length to variable length?
how can we pass parameters from JCL to cobol subprogram...my requirement is i should not get data from mainprogram but i need it from JCL directly
What is the use of the utility DFSRRC00 in the JCL?
what operation is performed by job statement?
I have a job which is a long-running one. Processes millions of records. Due to some run-time problem (not a problem due to the job/data) the job abends.What needs to be done to make the job complete successfully.
Hi Please try to be to-the-point. 1) How to INCLUDE a JCL segment in a JOB ? (A Small example) 2) What is SPOOL and what is SPOOL FULL ? and how to direct the output of a Jobstep to SPOOL ?