IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Invoke a REXX JCL inside a JCL and wait to finish


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Wed Jun 25, 2008 7:38 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jun 25, 2008 7:49 pm
Reply with quote

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
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Wed Jun 25, 2008 8:59 pm
Reply with quote

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 icon_sad.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jun 25, 2008 9:31 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 25, 2008 10:49 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Jun 25, 2008 11:30 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 26, 2008 12:01 am
Reply with quote

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
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Thu Jun 26, 2008 5:35 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 26, 2008 6:16 pm
Reply with quote

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
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Thu Jun 26, 2008 8:29 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 26, 2008 8:50 pm
Reply with quote

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
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Thu Jun 26, 2008 8:55 pm
Reply with quote

Thanks, I will investigate...

I see the light at the end of the tunel... now I'll need to find the tunel icon_lol.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jun 27, 2008 12:11 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
Search our Forums:

Back to Top