BookmarkSubscribeRSS Feed
Oleg_L
Obsidian | Level 7
Hello SAS-users.

I have to read raw data (.csv) into SAS dataset.

Some fields are date values in the form submitted below:

Apr 17 2007 12:00AM,Apr 17 2011 12:00AM
May 28 2007 12:00AM,May 28 2010 12:00AM

I can not find an appropriate informat to read this data into SAS date values.

Thanks in advance for any help.
2 REPLIES 2
Ksharp
Super User
[pre]
options datestyle=mdy;
data temp;
infile datalines truncover dlm=' ';
input dt anydtdtm24.;
format dt dateampm24.;
datalines;
Apr 17 2007 12:00AM
Apr 17 2011 12:00AM
May 28 2007 12:00AM
May 28 2010 12:00AM
;
run;
[/pre]


Ksharp
Oleg_L
Obsidian | Level 7
Thank you very much.
It works.

Oleg

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 765 views
  • 0 likes
  • 2 in conversation