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

Answer Posted / vishal

we can declare a record in file section and can pass the
statementa to that record as shown..

E.D
fole_control.
select jclfile assign to jcldd
file section.
fd jclfile
01 jcl_record pic x(80).

P.D.
mainpara.
open output jcl_record
move "//job job1, notify=&sysuid" to jcl_record.
move "//step1 exec pgm=pgm1" to jcl_record.
.......
.......
close jcl_record.

then route the file to internal reader INTRDR in jcl
as shown..
//step1 exec pgm=pgm1
//dd3 dd dsn.......
//jcldd dd sysout=(*,INTRDR)

(here the job will get submitted automatically FROM COBOL)

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is inspect in cobol ?

800


Which mode is used to operate the sequential file?

659


I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue

1930


Why did you choose to work with ibm mainframe cobol programming?

628


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1924






In COBOL, what is the different between index and subscript?

755


Explain how to differentiate call by context by comparing it to other calls?

684


What is rmode(any) ?

683


Name the sections present in data division.

699


What is the difference between comp and comp-3 usage?

676


what is search and searchall?what is the diffrence between them?give an best example?

5541


what is the use of outrecord?

1768


i want a program using by if, evaluate , string, unstring, perform, occurs?

4050


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5057


Write a program that uses move corresponding.

670