Hello out there, anyone know of a way to 'capture' a jcl error and force it to display a message to the console. This can be done easily when a job abends using cond code checking or if then else statements, but to the best of my knowledge, if the error is a JCL error the job just STOPS and no further steps will execute. I am particularly concerned in a case whereby we get a JCL error 'space requested not available' - we have procs that run that have the potential to get this error and we need to know about it right away if this condition is encountered...any ideas.
We have job scheduling tools (ca7 to be exact)...in this case, however, the 'job' in question is actually forced by a user exit in our ADABAS database...so there is no control by CA7 unfortunately. Anybody else have any ideas?
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
hy rsodergren,
if you have any scheduler, then you should not submit
any other job directly without control of your scheduler.
check how your scheduler schedules defined applications,
then create one job that will schedule a scheduler application,
which includes your job as you wanted, but then under control of
your scheduler...
I am sort of in a catch-22 with the scheduler tho because if I allow the scheduler to submit this job, then my database will 'think' that it has copied off its protection logs when in fact it may not have. The user exit handles all the business between the protection logs and the database. This would not be a good situation to be in. I guess bottom line, there is no way to capture jcl errors and cause another even to take place...unless I go the job scheduler route...which in this case I can't do.
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
rsodergren,
What kind of JCL errors are you trying capture?
Invalid syntax that is captured by the interpreter there is not much that can be done because the job is never started.
If the job will start, and then fail on a JCL error, we can probably capture, in a round about way. Let me know what you are trying to capture and I?ll see if I can come up with something.
I am trying to capture JCL errors after the job has started (not syntax errors). My biggest concern is a 'space requested not available' jcl error. This happens once in a blue moon. I am allocating a rather large first extent in a couple of my procsteps and if the SMS pool of volumes is rather fragmented or full due to a busy batch window this can spell trouble.
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
Russ,
Let me test a couple of ideas today. The direction that I'm thinking will require the addition of a couple of small steps in your job. Cannot guarentee anything, but I'll test my idea.
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
Russ,
OK, here?s what I cam up with. It?s kind of weird, but it does work.
Your original job with new steps, your original job replaces JS00200/JS00201. If you don?t want notification if your job abends, add COND=EVEN to JS00900:
And a new job to check the outcome of the first job. Replace JS00200 with whatever processing you want to do if the first job fails. Note that the JOBNAME must be the same as the first job.
Code:
This is the job submitted on JS00103 above in PDS YOUR.PDS.#TEST(JCLTEST2)
//YOURXXX JOB (ACCNT,ROOM),DavidatK,
// MSGCLASS=Y,NOTIFY=YOUR
//JS00100 EXEC PGM=IDCAMS
//INDD DD DSN=YOUR.PS.JCLVALID,
// DISP=(OLD,DELETE,DELETE)
//SYSIN DD *
PRINT IFILE(INDD) COUNT(1)
/*
//SYSPRINT DD DUMMY,LRECL=133
//*_______________________________________________________________
//* REPLACE JS00200 WITH YOUR EXCEPTION PROCESSING
//* IF THE CHECK FILE IS EMPTY (RC=4 FROM JS00100)
//*_______________________________________________________________
//JS00200 EXEC PGM=IEFBR14,
// COND=(0,EQ,JS00100)