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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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