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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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