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

check return code for multiple jobs


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Wed Oct 28, 2009 10:54 pm
Reply with quote

Hi

I have a set of jobs monitored as part of health check. how can this be automated?
Can I have all the job return code in single dataset so that i can email it check?
Or is there a better way for this?
icon_rolleyes.gif
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Oct 28, 2009 11:05 pm
Reply with quote

anilscomputer wrote:
I have a set of jobs monitored as part of health check. how can this be automated?


It could be done by employing the use of your site's scheduling system software, which exists pretty much to do just what you want. Or, you could take advantage of your site's other automation tools, depending on what they are and how available they are.

anilscomputer wrote:
Can I have all the job return code in single dataset so that i can email it check?


Yes, there are many topics you can search for that deal with procedures to track and log the batch job control blocks, which you could of course accumulate and process as you wish. There are also many topics that deal with using your spool interface tools (SDSF, IOF, Sysview, to name a few) to provide these types of details.
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Thu Oct 29, 2009 12:22 pm
Reply with quote

Thanks for the reply. As you said SDSF is an option currently used to check the status of jobs manually.
Please correct if am wrong?
1:System has a log for all the recent job log informations that has run, may be in a particular day. So searching this log or sorting this will help to identify the returncodes for the jobs. ( if so how can i get the log name?)
2: Writing a REXX code. ( Is there any piece of code so that i can amend to my need in getting the return code for multiple jobs)
3: Writing the maxx return code for each job in a dataset ? ( Dont know if this is feasible)

Is there any better option ? icon_rolleyes.gif
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: Thu Oct 29, 2009 8:17 pm
Reply with quote

Hello,

Before you try to develop anything, you need to talk with the scheduling people and learn what is already available.

One place to get this info is the SMF data. REXX, SAS, or something else might be used. . .
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 29, 2009 8:20 pm
Reply with quote

Also, if you explain the reason behind the request we may have other options available.
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Thu Oct 29, 2009 9:02 pm
Reply with quote

Thank you Dick
I have checked this with the scheduling Guys and could find that they use UC4 scheduler (recently migrated from CA7) and they dont have such facility developed currently.

Hi Expat
The requiement :
I have 15 jobs to be checked daily morning to ensure that they run fine yesterday. Currently i do this by SDSF manually visiting the return code for all jobs. So I need to know if there is any way to get these jobs status automatically. Hope this clarifies the requirement. icon_rolleyes.gif icon_rolleyes.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 29, 2009 9:06 pm
Reply with quote

Here's a piece of REXX code published earlier on this forum by superk which gives the return codes of all step in a job. It can be easily adapted to write to a dataset.
Code:

/* REXX *** GETRC *** GET THE STEP NAME AND RETURN CODE              *
NUMERIC DIGITS(32)                                                   
TCB=STORAGE(D2X(540),4)                                               
JSCB =STORAGE(D2X(C2D(TCB)+180),4)                                   
JCT = STORAGE(D2X(C2D(JSCB)+261),3)                                   
THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))               
FSCT = STORAGE(D2X(C2D(JCT)+48),3)                                   
TEMP_SCT = FSCT                                                       
DO I = 1 TO (THIS_STEP_NO - 1)                                       
  STEP = STORAGE(D2X(C2D(TEMP_SCT)+68),8)                             
  RCSTEP = X2D(C2X(STORAGE(D2X(C2D(TEMP_SCT)+24),2)))                 
  BYPASS = STORAGE(D2X(C2D(TEMP_SCT)+188),1)                         
  IF X2D(C2X(BYPASS)) = 80                                           
    THEN RCSTEP = 'FLUSHED '                                         
  SAY 'STEP ==>' STEP ' RC ==>' RCSTEP                               
  TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)                         
END                                                                   
EXIT                                                                 
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Thu Oct 29, 2009 9:17 pm
Reply with quote

Hi Expat
Sorry I could not make you clear about the requirement.

It is to get the return code of the 15 JOBs. Basically to know if any of these jobs has failed.

I am currently searching in REXX to know if this was posted earlier.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 29, 2009 9:22 pm
Reply with quote

The above code needs to be put into an IKJEFT01 step as the last step of each job.

The code needs to be amended to write the output to a dataset, and all you need to do is to look at the datasets in the morning and see what happened over night.
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Thu Oct 29, 2009 9:35 pm
Reply with quote

Thank You Expat for your valuable suggession.

Other than making changes in the existing production jobs is there any alternatives? I only need to know the job status for all jobs
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 29, 2009 10:37 pm
Reply with quote

anilscomputer wrote:
Currently i do this by SDSF manually visiting the return code for all jobs.


Again, as I already stated earlier, why couldn't you automate this process by writing a job (using the batch SDSF interface) or REXX exec (using the REXX interface) or both to do this for you?
Back to top
View user's profile Send private message
anilscomputer

New User


Joined: 26 May 2008
Posts: 7
Location: Trivandrum

PostPosted: Thu Oct 29, 2009 10:42 pm
Reply with quote

Thank You all for your valuable time.

I got some piece of REXX code from the forum and am into it.
icon_razz.gif
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: Thu Oct 29, 2009 11:29 pm
Reply with quote

Hello,

Good luck - someone will be here if there are questions/problems icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top