I have a directory with a large number of csv files. I want to import some of them without writing a separate proc import for each, because that would be silly. For arguments sake, let's say the files are named filename_ak.csv, filename_al.csv, filename_ct.csv. A resource I found elsewhere suggested that the following macro would work; %for(filename, values=filename_ak filename_al filename_ct, do=%nrstr( PROC IMPORT DATAFILE= "\\c:\datafiles\&filename.csv" OUT=WORK.&filename DBMS=CSV REPLACE; RUN; )) But I get error messages: WARNING: Apparent invocation of macro FOR not resolved. ERROR 180-322: Statement is not valid or it is used out of proper order. I am running SAS 9.4 on X64_10PRO Thanks in advance!
... View more