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 / 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

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

Answer / anoop

You can execute JCL from cobol programs.

Write the jcl statements into a file and open it in out put
mode.

Is This Answer Correct ?    8 Yes 12 No

Post New Answer

More COBOL Interview Questions

Suppose, file A has 100 records and file B has 500 records. We want to write records common to both A and B into file C and records which are present only in either A or B into another file D. What should be the logic of Cobol program to achieve this?

7 Answers   Bank Of America, Mind Tree,


IF I mention stop run in CICS what happens?

0 Answers   IBM,


I want ALL jcl ERROR cods

1 Answers  


i WANT ALL ERROR codes IN CICS and DB2

2 Answers  


How can you get the ksds file records into your cobol program?

0 Answers  






What is the maximum length of a field you can define using COMP-3 in COBOL?

1 Answers   UGC Corporation,


what is the minimum number of lines a Cobol program should have to successfully compile and run

11 Answers   ABC, Societe Generale,


What is the figurative constant in cobol?

1 Answers  


What is report-item?

1 Answers   IBM,


How much salary you are expecting? If they ask in an interview, what we have to tell?

6 Answers   Tech Mahindra, Wipro,


how to refer the data field?

0 Answers  


Can we use redefine clause in occurs clause?

10 Answers  


Categories