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;
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!
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.
Ready to level-up your skills? Choose your own adventure.