So you have a dataset with a variable that contains the name of the file that you want to read to create a new dataset? You do not have to use a macro variable in that case. You can use the FILEVAR option on the INFILE statement to tell it that the name of the file to read is already in a dataset variable. data ab_test ; if _n_=1 then set latest_file; infile dat filevar=flnm delimiter = '|' TRUNCOVER DSD lrecl=32767 firstobs=2 ; .... P.S. Use TRUNCOVER instead of MISSOVER and save yourself a lot of trouble when reading variable length lines.
... View more