View previous topic :: View next topic
|
Author |
Message |
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
Hi,
i am submitting a JOB in REXX,
i am able to trap the job details when the job is submitted without JCL ERRORS.
But i am not able trap JOB details when the job is submitted with JCL ERRORS.
TSO STATUS IS NOT GIVING INFO ABOUT JCL ERROR....
can anybody help about how to trap this information? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
How do you mean trap it.
The job being submitted by the REXX is a completely different address space to the REXX that submits it.
If you have SDSF you can run this in batch either as native SDSF or via REXX |
|
Back to top |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
HI,
HERE I AM SUBMITTING TWO JOBS.IN REXX....
I HAVE TO SUBMIT THE SECOND JOB ONLY ,IF I DID NOT GET JCL ERROR MESSAGE OR ANY ABENDS OR RETURN CODES..(ONLY MAXC=0) ALLOWABLE...
SO HOW TO TRAP (STORE) THE INFORMATION THAT JCL IS SUBMIITED WITH JCL ERROR OR WITH SOME ERROR CODE....SUCH THAT I CAN PROCEED FURTHER....... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Same class project - different school terms?
or
same company's interview? |
|
Back to top |
|
|
avaneendra_linga
New User
Joined: 13 Dec 2006 Posts: 73 Location: Hyderabad
|
|
|
|
hi....
i saw all the posts that SUPERK is mentioned ..but all the above wont solve my problem......
MY problem is how to know that JOB is submittted with JCL ERROR.....
PLEASE SEE MY CODE...BUT THROUGH THIS ,I AM NOT ABLE TO CAPTURE THE INFO ..THAT THE JOB IS SUBMIITED WITH JCL ERROR...
CAN ANY BODY GIVE SOME SAMPLE CODE FOR THAT...OR CORRECT THIS?
MINE:
X=MSG("ON")
X=OUTTRAP("SUB.")
SELECT
WHEN USUBOPTN = 'S' THEN
"TSOEXEC SUBMIT '"ZTEMPF"'"
WHEN USUBOPTN = 'E' THEN
ADDRESS ISPEXEC "EDIT DATASET('"ZTEMPF"')"
OTHERWISE
SAY 'NO JOB BUILT, DUE TO INVALID SUBMIT OPTION'
END /*SELECT*/
X=OUTTRAP("OFF")
DO I = 1 TO SUB.0
PARSE VAR SUB.I 'JOB' JOBNAME '(' JOBID ')' STATUS
END I
SUBJOBNAME = STRIP(JOBNAME,B)
SUBJOBID = STRIP(JOBID,B)
SUBJOB = SUBJOBNAME || "(" || SUBJOBID || ")"
JOBDONE = 'NO'
DO UNTIL JOBDONE = 'YES'
X=OUTTRAP("OUT.")
ADDRESS TSO "STATUS" SUBJOB
X=OUTTRAP("OFF")
DO I = 1 TO OUT.0
/*SAY OUT.I*/
PARSE VAR OUT.I 'JOB ' JOBNAME '(' JOBID ')' STATUS
STATUS = STRIP(STATUS)
IF POS('ON OUTPUT QUEUE',STATUS) > 0 THEN JOBDONE = 'YES
ELSE DO
CALL MYWAIT 10
END
END I
END
SUBRC=RC
SAY'SUBRC' SUBRC
/*ADDRESS ISPEXEC 'VPUT (JOBNAME JOBID)'
ADDRESS TSO "%JOBRC JOBANME JOBID" */
ADDRESS ISPEXEC 'VPUT (SUBRC)' |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You will have to wait (with some "sleep" function) until the job ends, then issue your X=OUTTRAP("OFF"), and only then start to loop through all the SUB. variables.
If I may put my personal opinion, waiting fot a background job to end fron foreground is a bad practice.
O. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
superk, perhaps it's a race to develop a REXX based scheduler package
ofer71 has hit a good point too, so I'll add my "very bad practice" too.
I'd guss the ideal option would be to use the schedular software - this is one of the main purposes of its existence, to control the flow of the scheduled work by time / event / failure. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
expat wrote: |
perhaps it's a race to develop a REXX based scheduler package. |
Maybe, but that's already been done. I remember a bulletin from IBM about a year ago, and it gave a link to a project developed by IBM India that was essentially just that - a TSO/ISPF based basic job scheduling system. They even provided all of the code for download and review.
I don't know, but I wonder if the code's still available on ibm.com? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If job2 is to always follow job1 when job1 completes successfully, job1 can send job2 thru the internal reader. There is no business reason to have rexx do this. There are quite a few examples of submitting jobs thru the internal reader in the forums.
The issue here (IMHO) is design deficiency. Before taking on the technical solution, what actually needs to be done should be considered - as well as existing capabilities.
And yes, hanging on a wait is not a good solution.
Using tools that already support the activity is better than inventing. Pretty much every scheduling system (automated or manual) supports job dependencies - i.e. job2 is dependent on the successful completion of job1.
FWIW. |
|
Back to top |
|
|
|