Page 1 of 2

Call a JCL by program.

PostPosted: Sat Oct 27, 2012 7:22 pm
by Mehdi shri
Dear friends:
I want to submit a JCL form a cobol program and give the MAXCC of the job. Then if MAXCC=0 the program can sense it and continue executing based on condition specified. How I must code my program?

Re: Call a JCL by program.

PostPosted: Sat Oct 27, 2012 7:40 pm
by enrico-sorichetti
How I must code my program?


You should realize that a submitted jcl will run asynchronous to the submitting process
might not even run for >some> time

wiser to review the whole process

and consider using Your scheduler/automation facilities

Re: Call a JCL by program.

PostPosted: Sat Oct 27, 2012 8:04 pm
by Robert Sample
How I must code my program?
First, redesign the entire process -- your design is broken. As Enrico pointed out, submitting a job from a COBOL program (or any other way) creates an independent process, and your code should not attempt to wait for that job to run, or attempt to check its completion code, or do ANYTHING with that job. This is why schedulers such as TWS, CA-7, and ZEKE exist.

Re: Call a JCL by program.

PostPosted: Sat Oct 27, 2012 11:37 pm
by NicC
MAXCC is an IDCAMS only item. Is IDCAMS involved in this process at all? Do you perhaps mean highest return code?
MAXCC has a specific meaning so use it properly and not as a shortcut for "highest return code"

Re: Call a JCL by program.

PostPosted: Mon Oct 29, 2012 8:18 pm
by Ed Goodman
Can you actually call the other program from your program instead of running it using JCL? That would give you a synchronous call, and let you examine a return code (maybe).

Re: Call a JCL by program.

PostPosted: Thu Nov 01, 2012 3:27 pm
by Mehdi shri
Mr. enrico-sorichetti
How I must use schedulers such as TWS, CA-7 and ZEKE to manage my process order?

Re: Call a JCL by program.

PostPosted: Thu Nov 01, 2012 8:08 pm
by enrico-sorichetti
why not ask Your operations support ?

You are not likely to get any answer on ANY forum for such question
there would be the need to rewrite quite a few/many pages of the manuals

and everything would also depend on the scheduler product in use in Your organization


and ...
DO NOT SOLICT FOR ANSWERS USING PMs

Re: Call a JCL by program.

PostPosted: Thu Nov 01, 2012 9:37 pm
by dick scherrer
Hello,

If you explain what you are really trying to do (Not submit a jcl from cobol), someone will have a suggestion because (if i understand what you want to do) as many have done the same thing in their environment.

No need to post entire job streams, just explain what needs to run in what order.

Re: Call a JCL by program.

PostPosted: Thu Nov 08, 2012 1:20 pm
by Mehdi shri
Dear dick scherrer
I have a cobol batch program(PROGA) that run from a JCL.The JCL have a SYSIN parameter that accepted by this batch program. This program read a value (from IMS DB. suggest PARM1) and calculate any things based on SYSIN parameter. The JCL run only once.
So I design another cobol batch program(MYPROG) that increments the value of PARM1 in 10 times. Now I want to run PROGA 10 times to calculation with diffrent values of PARM1. (for example PARM1.PARM1+1..PARM1+10).
Note: that I can't change the PROGA source. because I have only this load module. MYPROG is designed for testing functionality and performance of PROGA and PARM1 values may be incremented more than 1000 times also.
Special thanks.

Re: Call a JCL by program.

PostPosted: Fri Nov 09, 2012 7:57 am
by dick scherrer
Hello,

I've read thru this a few times now and unfortunately, i do not understand what is wanted.

If PROGA is to run only once and then multiple executions of MYPROG are to run, how does this test the functionality of PROGA? What does incrementing the value of PARM1 accomplish?

Someone needs to let management that the system is running with unsupportable code (i.e. there is none).