GANAPATH
New User
Joined: 06 Mar 2006 Posts: 35
|
|
|
|
Hi,
i submit lots of jobs everyday, i want to get an email
that consists of jobname and its return code, so that it is easy to see the result in that way. Can i do this through JCL
Thanks,
Ganapath |
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
GANAPATH wrote: |
Can i do this through JCL? |
I don't know about doing what you want strictly with JCL, as you need to access the job's JSCB control blocks for that information.
Here is a REXX exec that combines the code of two shareware exec's to provide the information you are looking for. You would run this as the last step of your job(s):
Code: |
/* REXX GETRC */
/* Find the job step with the highest Return-Code */
Numeric Digits(32)
Call GETJOB
Call GETRCS
Say 'JOB:'jnam' ID:'jnum
hi_step = ''
hi_rcstep = 0
Do j = 1 To (i-1)
Say 'STEP:'step.j' RCODE:'rcstep.j
If rcstep.j > hi_rcstep Then
Do
hi_step = step.j
hi_rcstep = rcstep.j
End
End
Say 'HIGHEST RC:'hi_step hi_rcstep
Exit 0
GETJOB:
/* Get the Job Name and Job Number */
tcb = PTR(540)
tiot = PTR(tcb+12)
jnam = STG(tiot,8)
jscb = PTR(tcb+180)
ssib = PTR(jscb+316)
jnum = STG(ssib+12,8)
Return
PTR: Return C2D(Storage(D2X(Arg(1)),4))
STG: Return Storage(D2X(Arg(1)),Arg(2))
GETRCS:
/* GET THE STEP NAME AND RETURN CODE INFORMATION */
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.i = Storage(D2X(C2D(temp_sct)+68),8)
rcstep.i = X2D(C2X(Storage(D2X(C2D(temp_sct)+24),2)))
bypass = Storage(D2X(C2D(temp_sct)+188),1)
If X2D(C2X(bypass)) = 80 Then
Do
rcstep.i = 'FLUSHED '
End
temp_sct = Storage(D2X(C2D(temp_sct)+36),3)
End
Return
|
|
|