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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1146 views
  • 0 likes
  • 2 in conversation