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!
The anydtdte informat can handle it
data test;
date='Jan-01-2008';
newdate=input(date, anydtdte12.);
format newdate date9.;
run;
The anydtdte informat can handle it
data test;
date='Jan-01-2008';
newdate=input(date, anydtdte12.);
format newdate date9.;
run;
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!
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.