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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm


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