From: Andrew Karp Sierra Info Services on 18 Mar 2010 02:24 Do we have an undocumented, perhaps, informat that would take a string that looks like the one below and covert it to a numeric SAS datetime variable value? Thanks is advance! The string is: Mar 17, 2010 12:47 PM PDT Andrew Karp Sierra Information Services http://www.sierrainformation.com
From: Patrick on 18 Mar 2010 05:02 Hi Andrew The following code reads the first 21 characters of your string and converts it to a SAS datetime value - PDT is ignored. data _null_; SASDateTimeNum=input('Mar 17, 2010 12:47 PM PDT',ANYDTDTM21.); put SASDateTimeNum= datetime21.; run; Considering the PDT zone: What would be your expectation that SAS does? To what time zone should the datetime value be shifted? Cheers Patrick
From: Andrew Karp Sierra Info Services on 18 Mar 2010 11:55 Hi Patrick...Thanks for this suggestion. I am not sure yet if "time zone" is an issue. My main concern was/is converting the string to a SAS datetime value variable. It's enough for now that we have a SAS datetime variable that shows the date and time of the event in the time zone in which it occurs. Perhaps later I will need to standardize the date/time to, say, UTC (Universal Time Coordinated) or a specific time zone in North America. But what you have provided works for now...thanks again! Andrew On Mar 18, 2:02�am, Patrick <patrick.mat...(a)gmx.ch> wrote: > Hi Andrew > > The following code reads the first 21 characters of your string and > converts it to a SAS datetime value - PDT is ignored. > > data _null_; > � SASDateTimeNum=input('Mar 17, 2010 12:47 PM PDT',ANYDTDTM21.); > � put SASDateTimeNum= datetime21.; > run; > > Considering the PDT zone: > What would be your expectation that SAS does? To what time zone should > the datetime value be shifted? > > Cheers > Patrick
|
Pages: 1 Prev: is this possible with proc kde Next: Problem with char variable |