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
 
Trapping JCL ERROR in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Trapping JCL ERROR in REXX
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 09, 2007 7:20 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Apr 09, 2007 8:20 pm    Post subject: Re: Trapping JCL ERROR in REXX
Reply with quote

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

http://ibmmainframes.com/viewtopic.php?t=19613
http://ibmmainframes.com/viewtopic.php?t=17906
http://ibmmainframes.com/viewtopic.php?t=17787
http://ibmmainframes.com/viewtopic.php?t=12263
http://ibmmainframes.com/viewtopic.php?t=13007
http://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

Site Director


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

PostPosted: Tue Apr 10, 2007 4:07 am    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Apr 10, 2007 10:53 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 10, 2007 12:12 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Tue Apr 10, 2007 6:42 pm    Post subject:
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

Site Director


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

PostPosted: Tue Apr 10, 2007 6:45 pm    Post subject:
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    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. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am


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