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
 

 

how to capture job name, its return code and send an email

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
GANAPATH

New User


Joined: 06 Mar 2006
Posts: 35

PostPosted: Wed May 31, 2006 1:18 am    Post subject: how to capture job name, its return code and send an email
Reply with quote

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
Back to top
View user's profile Send private message

rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Wed May 31, 2006 2:16 pm    Post subject:
Reply with quote

Yes we can do it...........

Check the utilites that you are using in your shop.......


Regards
jai
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed May 31, 2006 6:18 pm    Post subject: Re: how to capture job name, its return code and send an ema
Reply with quote

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                                                   
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts EMAIL using IEBGENER - SMTP parasmalik20 JCL & VSAM 4 Tue May 23, 2017 12:19 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am


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