View previous topic :: View next topic |
Author |
Message |
ashutosh_agl3 Beginner
Joined: 14 Aug 2003 Posts: 28 Topics: 15
|
Posted: Tue Nov 23, 2004 5:16 am Post subject: How to detemine if the JCL is complete in COBOL program |
|
|
I am creating and submitting a JCL dynamically through a COBOL program.
Is there any way to determine if the job has been completed and what is the return code for the job? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
MFBaba Beginner
Joined: 24 Nov 2004 Posts: 8 Topics: 4
|
Posted: Wed Nov 24, 2004 1:56 am Post subject: |
|
|
Kolusu,
Is there some way by which I can come to know when the JOB completes/abends in the same COBOL program which submitted the JCL ??
Thanks,
MFBaba. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Nov 24, 2004 9:07 am Post subject: |
|
|
MFBaba,
You can code a wait logic in your cobol pgm to wait untill the submitted job completes and sweep thru the control blocks to see if the job completed successfully or if it abended.
Search for "ILBOWAT0" in the application programming forum and you will find examples of it.
But this approach is a mere waste of resources and I wouldn't recommend it
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ashutosh_agl3 Beginner
Joined: 14 Aug 2003 Posts: 28 Topics: 15
|
Posted: Thu Nov 25, 2004 1:04 am Post subject: |
|
|
The objective here is to somehow identify the return code of the JCL in the same COBOL program which is submitting the JCL.
Currently the module submits and then exits.
I need a way to have COBOL module wait till the time JCL finshes normally/abnormally and also a way to identify the return code of JCL. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Nov 25, 2004 1:29 am Post subject: |
|
|
Ashutosh,
If you could provide us some more info as to what u r trying to do, probably we can suggest an alternate solution. How many steps do u have in the JCL which u submit internally. Can you show us ur JCL ? (the one which is going to be submitted by ur cobol program). Instead of submitting you can execute the entire JCL from inside the COBOL program itself, so that U donot have to wait for the JCL to complete.
Thanks,
Phantom |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Nov 25, 2004 10:28 am Post subject: |
|
|
Quote: |
I need a way to have COBOL module wait till the time JCL finshes normally/abnormally and also a way to identify the return code of JCL.
|
ashutosh_agl3,
Did you read my post which was posted just above your post? There are atleast 2 examples in this forum for the wait logic.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
ashutosh_agl3 Beginner
Joined: 14 Aug 2003 Posts: 28 Topics: 15
|
Posted: Fri Nov 26, 2004 12:10 am Post subject: |
|
|
Kolusu
The ILBOWAT0 reference you had provided explained a way to wait for a specified (X no.. of secs).
However what i need is to wait till JCL has finished executing (normally or abnormally)
The purpose out here is that since this JCL is being built and submitted dynamically thru a COBOL-CICS module, so the objective is to show some kind of information obtained as output of JCL.
For this the as per the current solution I was thinking it there was someway to determine JCL has finished in COBOL program then it might solve our purpose.
I am open to any other suggested solutions also. |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Fri Nov 26, 2004 1:13 am Post subject: |
|
|
Ashutosh,
Read Kolusu's message carefully.
Code: |
You can code a wait logic in your cobol pgm to wait untill the submitted job completes and sweep thru the control blocks to see if the job completed successfully or if it abended.
Search for "ILBOWAT0" in the application programming forum and you will find examples of it.
|
He wanted you to use ILBOWAT0 to make the COBOL program wait for some time say 10 secs then read the control blocks (TCB, TIOT...) to check whether the job completed or not, if so, what is the return code etc....If Not, then wait for another 10 secs and so on......
But as Kolusu said, this is not recommended as it wastes lot of CPU, unnecessarily looping during the wait period. Instead you can invoke the program called by the JCL direcly from within ur cobol program. This way do not have to wait for a jcl to complete.
Show us ur JCL and we'll tell you how.
Thanks,
Phantom |
|
Back to top |
|
|
|
|