Hi All,
I have a report that that i am importing to SAS in .csv format. The date is in character format (Thu Apr 04 17:15:32 GMT 2013) and I need SAS to read this as a normal date time format. The date and time are intermingled and I am not sure how to separate them and convert it to the proper date format.
I have been unable to find anything that will help me convert this. I have tried many things... but the way the date comes out is odd and i can't get it convert over to datetime no matter what i do. Does anyone know any tricks to do this?
Can't you just convert it yourself?
Say it is read in as a character string named TIME.
datetime = input(scan(time,3)||scan(time,2)||scan(time,-1)||':'||scan(time,4,' '),datetime.);
format datetime datetime19.;
If all of the records do not say GMT then you will need add some logic to adjust for time zone.
Can't you just convert it yourself?
Say it is read in as a character string named TIME.
datetime = input(scan(time,3)||scan(time,2)||scan(time,-1)||':'||scan(time,4,' '),datetime.);
format datetime datetime19.;
If all of the records do not say GMT then you will need add some logic to adjust for time zone.
Thank you for the help on this one. If it were one or two entries i could most certainly converted them manually... however... i am dealing with thousands of entries per day, hence why i wanted SAS to do the converting for me. I am not that great with these calculations, though i am getting better everyday.
Dean
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.