I need to import a large amount of csv files in one SAS dataset. They all have the same data structure (same variables, variable names on the first line). I usually work in SQL, but I am forced to this particular project in SAS of which I have only basic knowledge.
For the moment, my code looks like this:
proc import out=work.data
datafile = file1.csv
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
proc import out=work.newData
datafile = file2.csv
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
proc append base=work.data
data=work.newData force;
run;
and so on for file3.csv ... file4.csv.
There is, I am sure, a more elegant way of doing this, that is, looping over all csv files on one folder without writing them explicitly (there are a few thousand files).
Thanks for your help.