View previous topic :: View next topic |
Author |
Message |
coder Beginner
Joined: 08 Jan 2007 Posts: 2 Topics: 1 Location: Chicago, IL
|
Posted: Wed Feb 14, 2007 5:19 pm Post subject: Programmatically querying abend and reason codes |
|
|
Does anyone know of a way to programmatically retrieve the abend return code and reason code of a prior job step?
As an example of what I need to do, lets say I have a three steps job running. If any of the first three steps abend or throw an RC, I want to conditionally execute a "logging step" which will be a (C or HLASM, preferably C) program that retrieves the abend information (return and reason codes) and does something with that information (like updating a master log of sorts).
//STEP1 EXEC PGM=STEP1
//STEP2 EXEC PGM=STEP2
//STEP3 EXEC PGM=STEP3
// IF ( ABEND | RC > 0 ) THEN
//LOGSTEP EXEC PGM=LOGSTEP
// ENDIF
Some time ago I was able to do something similar using the SWAREQ macro in an HLASM program, but I believe I was only able to get at the return code, and not the reason code.
Can anyone point me in the right direction? Thanks! |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Thu Feb 15, 2007 5:12 pm Post subject: |
|
|
Coder,
Is this LOGSTEP is your pgm which will create/update the log file. or your asking how to copy the system messages to a file? |
|
Back to top |
|
 |
coder Beginner
Joined: 08 Jan 2007 Posts: 2 Topics: 1 Location: Chicago, IL
|
Posted: Thu Feb 15, 2007 6:45 pm Post subject: |
|
|
Kiran,
Yes, LOGSTEP is the program I am writing that will be logging information, like the user, jobname, abend information and doing various other things like email notifications to appropriate personnel. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Feb 16, 2007 5:04 am Post subject: |
|
|
If your prior steps wrote their dignostics to file rather than sysout your log program can query those files. You could use parameters to pass in jobname/user info, or - if you are writing your log program in assembler then you could possibly access the relevant control blocks - but that is way beyond me. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Feb 16, 2007 5:23 am Post subject: |
|
|
i suggest going thru the CBT TAPE table of contents at www.cbttape.org. There are a couple of ways to read the jes of a job either after the fact or as part of the job.
do you not have a scheduling system? Most have functions that provide for notification of job problems.
though your solution will effect notification and logging, what i suggest is that you implement in the interm a less intensive method -using the scheduler - proven, debugged system -
(whereas you are writting something which will be introduced to every job - how long are you going to answer calls in the middle of the night until you have worked all the kinks out?)
and attack the problem where it lies - poorly documented, multimethod error handling by programs - and implement a standard communications methodology between jobs/programs and the individual responsible when problems occur.
the cbt tape can provide you something if you don't want to use the scheduler option. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Feb 16, 2007 8:59 am Post subject: |
|
|
There are also control blocks you can chase, at least for return codes -- not sure about abend and reason codes. Search the board for examples. |
|
Back to top |
|
 |
vak255 Intermediate

Joined: 10 Sep 2004 Posts: 384 Topics: 79
|
Posted: Fri Feb 16, 2007 2:58 pm Post subject: |
|
|
I think all you have to do is copy from sysout/Abend log. it depends on what you want to copy. I have seen some links where there is a command to copy system messages. try to serach here, or if i come across i willl keep u posted. |
|
Back to top |
|
 |
|
|