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

Queueing JOBS thru Rexx


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

New User


Joined: 08 Jun 2006
Posts: 22

PostPosted: Sun Sep 24, 2006 1:31 pm
Reply with quote

Hi All,

I have 10 Jobs stored in "abc.ef.jk" PDS.
now i want a rexx macro by which i can submit all 10 jobs but job2 gets executed only after the successful completion of JOB1.
can anybody help me out in this .
code snippets are most welcome

Ashutosh
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Tue Sep 26, 2006 12:46 am
Reply with quote

I presume you have a valid reason for wanting to do things this way, and that you're OK with the fact that you'll be tying up your TSO session.

Anyway, here's a rather generic process you can modify as you see fit.

1. When you submit the job, make sure you trap the jobname and number (jobid).

2. Use a loop to check for the job status with the TSO STATUS command:
"STATUS jobname(jobid)"
and capture the output. You'll need to wait until you see the message:
"IKJ56192I JOB jobname(jobid) ON OUTPUT QUEUE".

3. Use the TSO OUTPUT command to retrieve the job output from the JES spool to a dataset:
"OUTPUT jobname(jobid) PRINT(dsname) BEGIN HOLD KEEP"

4. Read the OUTPUT command dataset. Look for the jobstep completion messages:
"IEF142I jobname [procstep] stepname - STEP WAS EXECUTED - COND CODE 0000"
You'll probably want to check for the highest return-code value from any of the steps. Take whatever action from that point.
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Mon Oct 02, 2006 8:44 am
Reply with quote

It would make more sense NOT to us REXX for this, but use JCL in job1 to submit job2 when it completes.

Code:

//SUBMIT     EXEC PGM=ICEGENER                         
//SYSUT1     DD DSN=JCL.LIB(job2),DISP=SHR   
//SYSUT2     DD SYSOUT=(F,INTRDR),DCB=BLKSIZE=80       
//SYSIN       DD DUMMY                                   
//SYSOUT    DD SYSOUT=*                               
//SYSPRINT  DD SYSOUT=*                               
//*                                                   
Back to top
View user's profile Send private message
Sahoo

New User


Joined: 08 Jun 2006
Posts: 53

PostPosted: Mon Oct 02, 2006 12:11 pm
Reply with quote

Make all the Jobcards same. So they will run in the sequece they were submitted.
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Tue Oct 03, 2006 5:39 am
Reply with quote

smilingashutosh wrote:
only after the successful completion of JOB1.
If all job names are the same, the requirement of successful completion cannot be controlled.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top