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 happens if parmparameter passes zero bytes to the program

1856


Whats the difference between search & search ALL?

5831


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

891


Why would you use find and get rather than to obtain?

881


How do get the result of your program directly on your pc?

2054






How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2940


What is the difference between PIC 9.99 and PIC9v99?

1019


What is the problem of ordered sequential files access?

894


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2581


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

7266


Discuss about changing dataset name in proc.

946


What are the rules of the move verb?

928


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

834


What is the Purpose of Pointer in the string?

810


Which is not true about evaluate statement

2067