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

Make REXX wait till the Jobs get executed


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

New User


Joined: 25 Feb 2006
Posts: 38
Location: chennai-india

PostPosted: Wed Jun 04, 2008 1:54 am
Reply with quote

Hi All,

I have created a job were it does the below process,
Step 1: Creates 10 JCL's using the SKEL.
Step 2: Submits all the JCLs using Fileaid step
Step 3: Executes a Rexx routine to create a report for the datasets created in step 2.

My problem is step 2 submits all the 10 jobs but after doing that it executes step 3 were it will try to use the files which are getting created in step 2 werer it fails.

How to make the step 3 wait till the step 2 jobs gets completed.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jun 04, 2008 2:16 am
Reply with quote

som,

Your requirement is not that clear.

Quote:
have created a job were it does the below process,
Step 1: Creates 10 JCL's using the SKEL.
Step 2: Submits all the JCLs using Fileaid step
Step 3: Executes a Rexx routine to create a report for the datasets created in step 2.


How are you creating those 10 JCL's??? Is that coded in REXX?

How are the JCl's submitted? automatically or how??

how is step2 connected to step 3 ? both the steps are in teh same job or what?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jun 04, 2008 2:20 am
Reply with quote

Hello,

You could change your process to submit 1 job rather than 10 (which may be preferable to the data center anyway). When the 10 processes complete, the rexx code could run as the last step of tghe job.

Aother possibility is to have the entire process set up with the scheduling software. The rexx process (step3) would be delendent on the other job(s) successfully completing.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Jun 04, 2008 2:23 am
Reply with quote

There is not really a good way to wait for the other jobs. The jobs are asynchronous with each other.

Some suggestions:
1. serialize the jobs, either by using the same job name, by using the same job class (only one initiator selecting that class), or make them into a single long multi-step job.

2. instead of printing your report in step 3, make it job 11 after your other 10 jobs.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jun 04, 2008 11:30 am
Reply with quote

And also search the forum, as this topic has been done and dusted several times before. Quick recap ...........

You want to hang your terminal until the jobs have processed
- Ok, so all initiators are in use and will be for a couple of hours. What will you do in the meantime ?
- One of the jobs fails - how are you going to know about.
- Various other points mentioned in previous topic discussion.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Jun 04, 2008 3:07 pm
Reply with quote

Hi,

years ago, before scheduling tools were around, I remember being confronted with a similar problem.

This is how I got around the problem.

1. Created a Control file with a flag of NNNNNNNNNN for each of the 10 jobs

2. Each of the 10 jobs that ran had 2 additional steps,

First additional step updated the control file with relevant flag set to Y and checked if all flags were set to YYYYYYYYYY, if so it returned a condition to kick off the second additional step which submitted job 11.

If not equal to YYYYYYYYYY then second additional step flushed.



Gerry
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top