I bind to convert a comma delimited text file to a channel delimited file, but my input file name (comma delimited file) is a variable (flname1). I am using the code suggested by the stackoverflow element. The code works fine as long as I specify the file name in the infile statement, but I don't know how to specify the file name as a variable -
data _null_;
enddate=date();
flname1=compress("d:\temp\wq_" || year(enddate) || put(month(enddate),z2.) || ".txt");
length x1-x6 $200;
infile 'flname1' dsd dlm=',' truncover;
file 'C:\temp\pipe.txt' dsd dlm='|';
input x1-x6;
put x1-x6;
run;
I am new to SAS and any help would be greatly appreciated. Thanks!
source
share