This question already has an answer here:
- Append multiple CSV files in SAS 5 answers
I am pretty new to SAS. I have a bunch of files that are in csv format that I want to read into SAS. I need to read them in one-by-one and save them, either individually or preferably in one huge file. (Although the file might be really large...not sure how to best deal with this - MySQL maybe?)
Say the file are named like this:
file97.csv
file98.csv
file99.csv
file00.csv
file01.csv
file02.csv
How can I loop over the 97, 98, 99, 00, 01, 02
in a loop statement?
If I import just, say file97.csv
, the code is something like:
PROC IMPORT OUT= WORK.data97
DATAFILE= "\...\file97.csv"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
What code would I write to loop? I basically need to change only the 97
s.