Call a JCL by program.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Call a JCL by program.

Postby Mehdi shri » Sat Oct 27, 2012 7:22 pm

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?
Mehdi shri
 
Posts: 138
Joined: Sun Jan 16, 2011 6:30 pm
Has thanked: 57 times
Been thanked: 0 time

Re: Call a JCL by program.

Postby enrico-sorichetti » Sat Oct 27, 2012 7:40 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Call a JCL by program.

Postby Robert Sample » Sat Oct 27, 2012 8:04 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Call a JCL by program.

Postby NicC » Sat Oct 27, 2012 11:37 pm

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"
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Call a JCL by program.

Postby Ed Goodman » Mon Oct 29, 2012 8:18 pm

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).
Ed Goodman
 
Posts: 341
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Call a JCL by program.

Postby Mehdi shri » Thu Nov 01, 2012 3:27 pm

Mr. enrico-sorichetti
How I must use schedulers such as TWS, CA-7 and ZEKE to manage my process order?
Mehdi shri
 
Posts: 138
Joined: Sun Jan 16, 2011 6:30 pm
Has thanked: 57 times
Been thanked: 0 time

Re: Call a JCL by program.

Postby enrico-sorichetti » Thu Nov 01, 2012 8:08 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Call a JCL by program.

Postby dick scherrer » Thu Nov 01, 2012 9:37 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Call a JCL by program.

Postby Mehdi shri » Thu Nov 08, 2012 1:20 pm

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.
Mehdi shri
 
Posts: 138
Joined: Sun Jan 16, 2011 6:30 pm
Has thanked: 57 times
Been thanked: 0 time

Re: Call a JCL by program.

Postby dick scherrer » Fri Nov 09, 2012 7:57 am

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post