Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Queueing JOBS thru Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Queueing JOBS thru Rexx
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    Post subject: Re: Queueing JOBS thru Rexx
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    Post subject:
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    Post subject: Re: Queueing JOBS thru Rexx
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    Post subject: Re: Queueing JOBS thru Rexx
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us