View previous topic :: View next topic
|
Author |
Message |
rafaelantunes
New User
Joined: 10 May 2007 Posts: 32 Location: Portugal
|
|
|
|
I want to create a job (aka JCL0000A) with 3 steps:
1st step - Executing a COBOL PGM; Don't have any problem here.
2st step - Condition of a RC. If the RC of the previous step is '0002' then finish the execution. If the RC of the previous step is '0000' then continue to execute a REXX job;
3rd step - In this step is where my major problem is. In here I want to wait for the end of execution of the third step (that is the REXX job) and submit the same JCL0000A, but only when REXX job is already finished.
Oh, I need to say that change the REXX job is out of question.
Thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
rafaelantunes wrote: |
If the RC of the previous step is '0000' then continue to execute a REXX job;
|
What exactly do you mean by this?
rafaelantunes wrote: |
In here I want to wait for the end of execution of the third step (that is the REXX job) and submit the same JCL0000A, but only when REXX job is already finished |
How exactly do you intend to accomplish this? How are you going to know when the "REXX job" is finished, especially if you can't modify that job at all? |
|
Back to top |
|
|
rafaelantunes
New User
Joined: 10 May 2007 Posts: 32 Location: Portugal
|
|
|
|
Quote: |
If the RC of the previous step is '0000' then continue to execute a REXX job; |
This means that:
If the return code of the program executed on the first step is 0 then I will submit another JCL.
Quote: |
How exactly do you intend to accomplish this? How are you going to know when the "REXX job" is finished, especially if you can't modify that job at all?
|
Well... that is where my problem is
I'm asking if there is a way to submit the other JCL on step two but only go to step three when the JCL has finished.
To give a trivial example:
In step one is executed a COBOL PGM but the step two is executed only after the program had finished.
So you're saying that there is no way to do this? No way to submit a external JCL with a special condition or someting?
Thanks for the reply.
[/quote] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Possibly, i misunderstand, but could you not simply add a 4th step to submit the necessary jcl - after the rexx completes? You would not need to change the rexx job. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
While there's ways to submit a job and wait until it completes before doing something, I'm not sure if this ability exists in REXX. EVENT waits and posts are complex. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What if there are no initiators available for the job you have submitted? How long will you wait for it to complete? What if the system is being shutdown for some reason and all the initiators are stopped, op's will be waiting for your job to finish and it will be waiting for another job that can't start? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
rafaelantunes, since we don't know your shop, I think it might be helpful if you could let us know how you normally determine the status of a job (is it running or is it complete) and maybe you could go from there. |
|
Back to top |
|
|
rafaelantunes
New User
Joined: 10 May 2007 Posts: 32 Location: Portugal
|
|
|
|
Ok...
Let me explain why do I need this.
My system has data.
Some of this data has been arquived by a process to cartrige.
I have a funcionality on my system to put some criteria to read from the cartrige and return the results.
Since reading from cartrige is slow, I keep the request of arquived data in a table.
At night during the batch process I will read the table and read the first record.
I will create a dataset with the criteria that the user has filled. (first step)
The program has been prepared to give a return code of 2 if there is one or more request in that day to process. Although it will only process one at a time.
My second step will read the return code and if the return code is 2 (it means that there are a request to process) than I will submit the REXX JCL that will use the dataset from step1 and will read the cartriges.
My problem is that I can not process the second request before the REXX finished and return the results.
Even if I use a copy of the dataset my problem will continue to exist.
So... If at the third step I wait for the REXX to finish, than I can process the second request.
I don't have any estimated time for REXX to process (it could take second, minutes, hours... I don't know).
My workaround is on the first step create a dataset with all the request from that day and give it to REXX that will process and it has time...
Although with this solution the REXX JCL has to be modifed and that it out of question...
Any idea...? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Do you have a way to programatically query the status of a processing job, interpret the results, and take an appropriate course of action? I'm thinking of facilities such as the TSO STATUS and OUTPUT commands, or spool management facilities like SDSF or IOF or Sysview. |
|
Back to top |
|
|
rafaelantunes
New User
Joined: 10 May 2007 Posts: 32 Location: Portugal
|
|
|
|
Well... I don't know... that's why I'm asking your help...
I also don't know if it is possible... Just wanna know what your experience has to say about this...
Many thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I've used TSO STATUS and TSO OUTPUT many times, and they have worked just fine. They exist for just this purpose. I can't personally comment on using SDSF since my site doesn't have that product, but I believe that it offers many more features that STATUS and OUTPUT don't. |
|
Back to top |
|
|
rafaelantunes
New User
Joined: 10 May 2007 Posts: 32 Location: Portugal
|
|
|
|
Thanks, I will investigate...
I see the light at the end of the tunel... now I'll need to find the tunel |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
I see the light at the end of the tunel... |
Are you sure it is the end of the tunnel, and not the 11:15 express train ? |
|
Back to top |
|
|
|