The macro is not generating the right code.
But you don't need macro logic to read 17 different files in a data step. Just data step logic.
%let pathname=some direcotry/;
%let file=some prefix;
%let ver=17;
data chk_lst;
length ver 8 fname $50 filename $256 lineno 8 line $900;
do ver=1 to &ver ;
fname=cats("&file",ver);
filename=cats("&pathname",fname);
infile logfile filevar=filename end=eof truncover;
do lineno=1 by 1 while (not eof);
input line $char900.;
output;
end;
end;
run;
... View more