kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
|
Posted: Wed Mar 31, 2021 9:33 am Post subject: |
|
|
rsantosh,
Most shops offload the syslog to a dataset at regular intervals. So if your shop has that mechanism then you can run DFSORT to extract the information.
here is a JCL that will extract the information from syslog datasets. The JCL assumes that the syslog dataset is LRECL=137, RECFM=VBA
Code: |
//********************************************************************
//* Use DFSORT JOINKEYS to generate the report for batch statistics *
//* from the syslog. *
//* *
//* Joinkeys will use the same syslog to match to itself *
//* *
//* INA will get jobid and jobnames that started using msg $HASP373 *
//* *
//* INB will get all the following values *
//* End time and EndRC from msg $HASP395 *
//* CPU TIME from msg TOTAL CPU TIME= *
//* ELapsed time is on the following Line after CPU time *
//* MAXCC is gotten from the msg MAXCC= (can also use $HASP165) *
//* *
//* A match is performed using JOBID and JOBNAME as keys and write *
//* out the matched values *
//* *
//********************************************************************
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD DISP=SHR,DSN=Your Syslog Dataset
//INB DD DISP=SHR,DSN=Same Syslog Dataset
//SORTOUT DD DSN=Your.REPORT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
JOINKEYS F1=INA,FIELDS=(05,09,A, $ JOBID + COMMA
14,09,A) $ JOBNAME + COMMA
JOINKEYS F2=INB,FIELDS=(05,09,A, $ JOBID+COMMA
14,09,A) $ JOBNAME + COMMA
REFORMAT FIELDS=(F1:05,30,
F2:23,40)
SORT FIELDS=(01,08,CH,A,
10,08,CH,A,
70,01,CH,A)
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(70,01,CH,EQ,C'1'),
END=(70,01,CH,EQ,C'3'),
PUSH=(31:31,11, $ END-TIME
57:57,04)), $ END-RC
IFTHEN=(WHEN=GROUP,
BEGIN=(70,01,CH,EQ,C'2'),
END=(70,01,CH,EQ,C'3'),
PUSH=(43:43,06, $ CPU TIME
50:50,06)) $ ELAPSED TIME
OUTFIL REMOVECC,NODETAIL,BUILD=(80X),
HEADER1=(',BATCH-STATISTICS Report as on,',DATE=(MD4/),/,
'Jobid ,Jobname ,Start time ,End time ,CPU Time,',
'Elap Time,End-rc,Maxx-rc'),
SECTIONS=(01,18,
TRAILER3=(01,48,2X,
49,07,3X,
56,05,2X,
61,05,4X))
/*
//JNF1CNTL DD *
OPTION VLSCMP
INCLUDE COND=((43,3,CH,EQ,C'JOB',OR,
43,3,CH,EQ,C'STC'),AND,
(62,8,CH,EQ,C'$HASP373'))
INREC BUILD=(01,04, $ RDW
43,08, $ JOBID/STC ID
C',', $ COMMA
71,08, $ JOBNAME
C',', $ COMMA
31,11, $ START TIME
C',') $ COMMA
/*
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(025,05,CH,GT,C' '),
PUSH=(025:025,35)),
IFTHEN=(WHEN=GROUP,
BEGIN=(106,15,CH,EQ,C'TOTAL CPU TIME='),
RECORDS=2,
PUSH=(138:SEQ=1,
140:063,08,
150:121,06)),
** GET JOB END RECORD**
IFTHEN=(WHEN=(062,07,CH,EQ,C'$HASP395'),
BUILD=(001,04, $ RDW
043,08, $ JOBID
C',', $ COMMA
071,08, $ JOBNAME
C',', $ COMMA
031,11, $ END TIME
C',', $ COMMA
6X, $ SPACES TO CPUTIME
C',', $ COMMA
6X, $ SPACES TO ELAPSED
C',', $ COMMA
091,04, $ END RC
C',', $ COMMA
4X, $ SPACES FOR MAXRC
C',', $ COMMA
C'END1', $ TEXT END
C',')), $ COMMA
** GET CPU/ELAPSED TIME RECORD **
IFTHEN=(WHEN=(138,01,CH,EQ,C'2'),
BUILD=(001,04, $ RDW
043,08, $ JOBID
C',', $ COMMA
140,08, $ JOBNAME
C',', $ COMMA
11X, $ SPACES FOR ENDTIME
C',', $ COMMA
150,06, $ CPU TIME
C',', $ COMMA
076,06, $ CPU TIME
C',', $ COMMA
4X, $ SPACES FOR ENDRC
C',', $ COMMA
4X, $ SPACES TO MAXRC
C',', $ COMMA
C'CPU2', $ TEXT END
C',')), $ COMMA
** GET MAXCC RECORD **
IFTHEN=(WHEN=(114,06,CH,EQ,C'MAXCC='),
BUILD=(001,04, $ RDW
075,08, $ JOBID
C',', $ COMMA
093,08, $ JOBNAME
C',', $ COMMA
11X, $ SPACES FOR ENDTIME
C',', $ COMMA
6X, $ SPACES TO CPUTIME
C',', $ COMMA
6X, $ SPACES TO ELAPSED
C',', $ COMMA
4X, $ SPACES TO ENDRC
C',', $ COMMA
120,04, $ MAXCC
C',', $ COMMA
C'RC 3', $ TEXT END
C',')), $ COMMA
IFTHEN=(WHEN=NONE,
BUILD=(001,04, $ RDW
59X'FF')) $ HIGHVALUE
/* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|