Thank you for help in advance!
I want to simply read in several text files that have the same format and in the same location.
The files have names like "Boston_M.txt", "Boston_F.txt", etc.
In a macro, I'm passing the city and gender variables - and that piece is resolving per the log.
However, my issue is what to do about the "_" in the text file names that separates the city and gender.
The log states:
ERROR: Physical file does not exist, /courses/d93a3ee5ba27fe300/c_8666/BostonM.txt.
Could someone suggest a modification in the infile statement as I cannot change the names of the original files.
%macro import_files (city, gender);
data &city&gender;
infile "/courses/d93a3ee5ba27fe300/c_8666/&city&gender..txt" dlm='_' TRUNCOVER;
INPUT ID 1-3 Race $4 State 6-8 ;
/* _infile_=translate(_infile_,'_','''');*/
/* _infile_=compress(_infile_," @%/.'?""");*/
run;
%mend import_files;
... View more