I would be very leery of letting an automated process with Proc Import read my data. As a minimum you should add the guessingrows=max option to have the best chance of consistent data.
Proc Import has to guess at lengths and types of variables and depending on the actual contents the types and lengths may change between files read.
I would suggest reading one file with import, go to the log and extract the data step generated and edit that code. Use the same code to read all of the files just changing input file names and output data set names.
If you go to combine data and get warnings or errors about mismatched data types or truncated character variables don't say you haven't been warned.
You should be able to create a macro variable with today's date in that format.
%let today=%sysfunc(today(),yymmddd10);
And then use the macro variable in the filename.
Datafile ="h:\report &today..csv"
Make sure to have a "extra" period. The first one will be used by macro processor to indicate the end of the macro variable name and the second one will become part of the generated filename.
You could just put the macro function call directly into the string, that will eliminate the need for the macro variable and the extra period.
Datafile ="h:\report %sysfunc(today(),yymmddd10).csv"
I would be very leery of letting an automated process with Proc Import read my data. As a minimum you should add the guessingrows=max option to have the best chance of consistent data.
Proc Import has to guess at lengths and types of variables and depending on the actual contents the types and lengths may change between files read.
I would suggest reading one file with import, go to the log and extract the data step generated and edit that code. Use the same code to read all of the files just changing input file names and output data set names.
If you go to combine data and get warnings or errors about mismatched data types or truncated character variables don't say you haven't been warned.
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 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: