MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Display SMF Start and end date / time

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nickciancio
Beginner


Joined: 12 Aug 2011
Posts: 2
Topics: 1

PostPosted: Fri Jul 12, 2019 11:30 am    Post subject: Display SMF Start and end date / time Reply with quote

Hello,

I have a large sorted VB SMF file that contains records from multiple days.

The time is in binary format in columns 3-6 and the date is packed in columns 7-10.

The file is sorted by date and time.

I would like to ONLY display or extract the date and time for the earliest (first) record and the oldest record.

example output would be
Code:

BEGIN DATE =mm/dd/yyyy TIME =hh:mm:ss
END    DATE =mm/dd/yyyy TIME =hh:mm:ss

The input looks like....
Code:

 1       5        10        15        20        25        30        35
/\------/\--------/\--------/\--------/\--------/\--------/\--------/\
5EF100812ADB0119190FC1F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF10081BEB00119190FC1F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF1006D622C0119191FC1F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF1000CAECA0119192FC1F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF10052727B0119188FC2F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF10052727B0119188FC2F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF10052A8790119188FC2F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000
5EF10054C28D0119188FC2F1F6F8D6D7E2E20BB9F1F34BF0F04BF0F000000000000000


Can this be performed using DF/SORT ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Fri Jul 12, 2019 5:28 pm    Post subject: Reply with quote

nickciancio,

It is quite simple to reformat the date and time in SMF records.

nickciancio wrote:
The time is in binary format in columns 3-6 and the date is packed in columns 7-10.The file is sorted by date and time.


Since the input is a VB file, you need to add the 4 bytes of rdw to the positions of dates and time. Use the following DFSORT JCL(Untested) which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=Your Input VB SMF dataset
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *   
  OPTION COPY
  OUTREC BUILD=(001,04,                            $ RDW               
                011,04,DT1,EDIT=(TTTT/TT/TT),      $ DATE               
                X,                                 $ SPACE             
                007,4,TM1,EDIT=(TT:TT:TT))         $ TIME               
                                                               
  OUTFIL REMOVECC,NODETAIL,VTOF,                             
     BUILD=(80X),                                               
   HEADER1=('BEGIN DATE : ',10,5,'/',5,4,' TIME : ',16,08), 
  TRAILER1=('  END DATE : ',10,5,'/',5,4,' TIME : ',16,08)   
/*


PS : if your input dataset is NOT sorted you can add the INREC and SORT statement instead of OPTION COPY
Code:

  INREC BUILD=(001,04,                             $ RDW   
               007,04,                             $ TIME   
               011,04)                             $ DATE
 
  SORT FIELDS=(9,4,PD,A,                           $ DATE   
               5,4,PD,A)                           $ TIME   

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nickciancio
Beginner


Joined: 12 Aug 2011
Posts: 2
Topics: 1

PostPosted: Mon Jul 15, 2019 6:49 am    Post subject: Reply with quote

Thanks... your JCL does exactly what I desired...
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jul 16, 2019 5:06 am    Post subject: Reply with quote

Actually, it his sort control statements that do the work, not the JCL.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group