Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
CA-SAR to get start time and end time of a batch.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Mon Mar 16, 2009 12:57 pm    Post subject: CA-SAR to get start time and end time of a batch.
Reply with quote

hi,
I have CA-SAR. Can anybody please help me to get start time and end time of a batch.
Means how to find out first and last job of a batch trail.

Thanks,
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Mon Mar 16, 2009 9:47 pm    Post subject:
Reply with quote

This can be done if u tailor the below steps to your requirement.


1)Generate parms to decide which Generation of output u need in SAR.
2) Get the details of the starting and the ending job timings in batch.
3) Process it using REXX.


1) If u need to get the details of the most recent run of a job from then u can generate this below parm (OR have it readymade in a PDS member)

Code:
/LOAD ID=CICDLMC GEN=-0


CICDLMC - required job name...

-0 stands for the most current job in SAR, -1 corresponds to last but first and so on.....


2) Use the below step to get SAR data into the PS member XK89.BOMB.DATA. I guess the PGM name might be different in ur shop,
Ask your SAR administrators.

Code:
//UNLOAD   EXEC PGM=SARBCH,PARM='SAR.SARJLD01'   
//SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133           
//REPORT   DD SYSOUT=*,DCB=BLKSIZE=133           
//SARLOAD  DD DSN=XK89.BOMB.DATA,DISP=MOD         
//SYSIN    DD *                                   
/LOAD ID=CICDLMC GEN=-0                                       
/* 


3) Process it using REXX.

Code:
/*REXX*/                                           
"ALLOC F(THINK) DS('"XK89.BOMB.DATA"') SHR"         
"ALLOC F(THINKS) DS('"XK89.JWA.OUTPUT"') MOD"     
"EXECIO * DISKR THINK (FINIS STEM IN."             
DO I = 1 TO 7                                     
IF SUBSTR(IN.I,20,9) = 'ICH70001I' THEN           
DO                                                 
  DATETIME = SUBSTR(IN.I,54,40)                   
END                                               
IF SUBSTR(IN.I,20,7) = 'IEF403I' THEN             
DO                                                 
  JOBNAME = SUBSTR(IN.I,28,8)                     
END                                               
END                                               
OUT.0=1                                           
OUT.1= JOBNAME 'LAST RUN WAS AT' DATETIME         
"EXECIO * DISKW THINKS (FINIS STEM OUT."           
"FREE FILE(THINK)"                                 
"FREE FILE(THINKS)"                               
EXIT       



Use the above 3 steps for finding the start time of the batch trail. U may have to edit ICH70001I in the above REXX code for reading the end time of the batch trail. That I will leave it to you.

Let me know your comments if you try it.
Happy coding icon_biggrin.gif
Back to top
View user's profile Send private message
ajaybshukla

New User


Joined: 09 Sep 2008
Posts: 39
Location: india

PostPosted: Tue Mar 17, 2009 9:35 am    Post subject:
Reply with quote

hi thanks for ur reply...sorry to say i m not aware of REXX...so is there any other way in this tool to find out this....
but i will surely try ur solution
once again thank u very much...
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1522
Location: Chennai

PostPosted: Tue Mar 17, 2009 1:31 pm    Post subject:
Reply with quote

Hi,

If you follow the first 2 steps, then u will have the JES data of the specified job in xk89.bomb.data.

The contents will be something like this,


Code:
********************************* Top of Data **********************************
                                                                               
                        J E S 2  J O B  L O G  --  S Y S T E M  M V S E  --  N O
                                                                               
03.18.02 JOB05566 ---- TUESDAY,   17 MAR 2009 ----                             
03.18.02 JOB05566  IRR010I  USERID XCICS    IS ASSIGNED TO THIS JOB.           
03.18.03 JOB05566  ICH70001I XCICS    LAST ACCESS AT 03:18:03 ON TUESDAY, MARCH
03.18.03 JOB05566  $HASP373 DLLCPGAL STARTED - INIT 4    - CLASS P - SYS MVSE   
03.18.03 JOB05566  IEF403I DLLCPGAL - STARTED - TIME=03.18.03                   
03.18.03 JOB05566  TES0001I                                    --- EXCP -- (MINS
03.18.03 JOB05566  TES0002I JOBNAME  STEPNAME PROCSTEP    RC   DISK  OTHER    CP
03.18.03 JOB05566  TES0003I DLLCPGAL COPY2    TRNKCOPY    00      2      0    .0
03.18.03 JOB05566  TES0003I DLLCPGAL HOSTPG   GDGUPD01    00      4      0    .0
03.18.04 JOB05566  IEC130I A02      DD STATEMENT MISSING                       
03.18.04 JOB05566  TES0003I DLLCPGAL HOSTPG   SWEOF       00      0      0    .0
03.18.04 JOB05566  IEF404I DLLCPGAL - ENDED - TIME=03.18.04                     
03.18.04 JOB05566  TES0004I DLLCPGAL ENDED.  NAME-                     TOTAL CPU
03.18.04 JOB05566  $HASP395 DLLCPGAL ENDED                                     
------ JES2 JOB STATISTICS ------                                               
  17 MAR 2009 JOB EXECUTION DATE   



In the above data, the time in the line containing the WORD ICH70001I
is the start time of the job. Use some programming language or DFSORT to extract the date.
DFSORT is very powerful try it out...
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us