an embarrassing rookie question...new to sas programming.
I'm trying to print out SMF 118 tcpip records and there are two 4 byte bin fields denoting the time of transmission and end of transmission which I believe is in seconds since midnight.
When I code the fields as smfstamp8 I only get a very few times in the reports.
(most just show as dots)
When I code the fields as pib4, all times show on the report (no dots) but appear to be all off.
FORMAT STIME TIME. ETIME TIME. ;
input @57 STARTED PIB4.
@61 ENDED PIB4.
STIME = TIMEPART(STARTED);
ETIME = TIMEPART(ENDED);
Any direction on where I've gone south on this?
Perhaps these STARTED and ENDED times are "seconds since midnight" ??? as their PIB4. fields do not show time values when printed:
KEEP FTPCMD RHOST LHOST LOCID STARTED ENDED BYTES DSN;
INPUT @2 REC_TYPE PIB1. @;
IF REC_TYPE NE 118 THEN DELETE;
INPUT @19 SUBTYPE PIB2. @;
IF ((SUBTYPE NE 75)) AND ((SUBTYPE NE 74)) THEN DELETE;
INPUT @21 FTPCMD $4.
@29 RHOST PIB4.
@33 LHOST PIB4.
@45 LOCID $8.
@57 STARTED PIB4.
@61 ENDED PIB4.
@65 BYTES PIB4.
@73 DSN $44.
The STARTED & ENDED times are printing out as shown below:
So if timepart is not the function that will format the above to readable times,
(I also could not get
FORMAT STARTED TIME. ENDED TIME. ; to work.
Do I need to put together a formula to convert these values from seconds from midnight to readable times??
thanks for your help
The time-fields are in 1/100th of a second (check the IBM TCP/IP SMF type 118 record source documentation) so you must use PIB4.2, not PIB4. to read those fields. Also, you will likely want to apply some TIMEw.d SAS format.
Do consider that these fields are only the time and if you have a negative difference when computing elapsed time between END-START, then you will need to handle this condition. There is another DATETIME field in the SMF record header which may help with your calculating an accurate "date portion" though.
Also, you may want to check with your SAS administrator and other mainframe SAS uers -- to determine if your site is licensed for MXG from Merrill Consultants http://mxg.com/ which has predefined SAS routines to read up this and many other data sources to build MXG / SAS PDBs (performance data bases).