View previous topic :: View next topic
|
Author |
Message |
smilingashutosh
New User
Joined: 08 Jun 2006 Posts: 22
|
|
|
|
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 |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
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 |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
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 |
|
|
Sahoo
New User
Joined: 08 Jun 2006 Posts: 53
|
|
|
|
Make all the Jobcards same. So they will run in the sequece they were submitted. |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
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 |
|
|
|