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

Trapping JCL ERROR in REXX


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

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Mon Apr 09, 2007 6:32 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 09, 2007 7:20 pm
Reply with quote

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
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Mon Apr 09, 2007 7:52 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Apr 09, 2007 8:20 pm
Reply with quote

expat, is it just me, or do all these posters:

ibmmainframes.com/viewtopic.php?t=19613
ibmmainframes.com/viewtopic.php?t=17906
ibmmainframes.com/viewtopic.php?t=17787
ibmmainframes.com/viewtopic.php?t=12263
ibmmainframes.com/viewtopic.php?t=13007
ibmmainframes.com/viewtopic.php?t=11550

seem to working on the exact same project?
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: Tue Apr 10, 2007 4:07 am
Reply with quote

Hello,

Same class project - different school terms?
or
same company's interview? icon_smile.gif
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Tue Apr 10, 2007 9:08 am
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Apr 10, 2007 10:53 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Apr 10, 2007 12:12 pm
Reply with quote

superk, perhaps it's a race to develop a REXX based scheduler package icon_smile.gif

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Apr 10, 2007 6:42 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Apr 10, 2007 6:45 pm
Reply with quote

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
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 Error when install DB2 DB2 2
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top