Some of us find SAS's INPUT @3 SMFTIME SMFSTAMP8.; FORMAT SMFTIME DATETIME21.2; PUT SMFTIME=;
easier and it prints 27OCT2013:13:14:15.99 Barry -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Elardus Engelbrecht Sent: Tuesday, October 29, 2013 2:33 AM To: [email protected] Subject: Re: Getting the SMF time Donald Likens wrote: >I figured out the problem... The SMFTIME is obtained by TIME BIN which returns >BIN returns the time of day as an unsigned 32-bit binary number with the >low-order bit equivalent to 0.01 second. The second word of the time value >returned is zero. STCK time is based on micro seconds. Yes. SMF<type>TIME is 2 full words. As documented it is 'Time since midnight, in hundredths of a second'. Granted, I have not time to play around with TIME macro on SMF data/time, but only used to get local time or Greenwich time. >To have the work close I would need to multiply the SMFTIME by 1000000 (if I >figured this correctly)... I choose to handle my problem a different way. Why 'multiply the SMFTIME by 1000000'? On what is that value based? I must missing something obvious. What I do (I believe there are better and elegant handling of those SMF date and times in Assembler or in LE languages to get your values. I think freebies on CBTTAPE like DAF have source samples for that too.): I take the value, SMF30TME for example, feed it into CONVTOD TIMETYPE=BIN, then to STCKCONV TIMETYPE=DEC, divide it by 360000 to get my hours. Divide remainder by 6000 to get my minutes. Divide remainder by 100 to get my seconds and last remainder. Then I do my converts, force sign and unpack these values. Some MOVes later I have all my values placed in a nice string pre-filled in with separators ready for display on reports. I do similar work for dates to extract year, month and day from my SMF records which are in Julian format and strange century bit (somewhat weird. :-D ). Not perfect, but it is working because I need to compare those date/times with parameters given for my reports. ;-) I can e-mail to you the partial source (in Assembler), if you wish. I used that to write out audit reports directly from SMF records. Groete / Greetings Elardus Engelbrecht ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
