BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wernie
Quartz | Level 8

I can't seem to figure this out for some reason. I'm trying to import a .CSV file into SAS. It's a very large file (~20 million + records), so I can't easily change something in Excel, etc. The date appears in the format of MON-DD-YYYY, so an example is Jan-01-2008. How do I use an informat to make sure this gets into SAS properly?

 

I used Proc Import and then tried editing the code in the log to change the informat and nothing I'm doing gets the proper format. The closest I've gotten is just something like JAN2008, but no day. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

The anydtdte informat can handle it

 

data test;
   date='Jan-01-2008';
   newdate=input(date, anydtdte12.);
   format newdate date9.;
run;

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

The anydtdte informat can handle it

 

data test;
   date='Jan-01-2008';
   newdate=input(date, anydtdte12.);
   format newdate date9.;
run;
wernie
Quartz | Level 8
Thank you! I thought I had tried that, but I guess not. That worked.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 567 views
  • 1 like
  • 2 in conversation