Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Invoke a REXX JCL inside a JCL and wait to finish

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Invoke a REXX JCL inside a JCL and wait to finish
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

Moderator Team Head


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

PostPosted: Wed Jun 25, 2008 7:49 pm    Post subject: Re: Invoke a REXX JCL inside a JCL and wait to finish
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    Post subject:
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

Site Director


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

PostPosted: Wed Jun 25, 2008 9:31 pm    Post subject:
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: 8199
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jun 25, 2008 10:49 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jun 26, 2008 12:01 am    Post subject: Reply to: Invoke a REXX JCL inside a JCL and wait to finish
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jun 26, 2008 6:16 pm    Post subject: Reply to: Invoke a REXX JCL inside a JCL and wait to finish
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jun 26, 2008 8:50 pm    Post subject: Reply to: Invoke a REXX JCL inside a JCL and wait to finish
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    Post subject:
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: 8617
Location: Back in jolly old England

PostPosted: Fri Jun 27, 2008 12:11 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us