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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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