Hello,
I want full path of filename using " * ".
But follow code gets only "c:\temp\*.csv
".
filename test "c:\temp\*.csv";
data want;
infile test dsd;
length path $256;
input a b;
path=pathname('path');
run;
What I want is the value of the following path variable.
c:\temp\a.csv
c:\temp\b.csv
c:\temp\c.csv
I can get path value by using filename with pipe, dir command and loop proc import, but if i use filename with " * " is easy.
Thanks all help.
Do this:
data want;
length path fname $256;
infile "c:\temp\*.csv" dsd filename=fname;
path = fname;
input a b;
run;
Do this:
data want;
length path fname $256;
infile "c:\temp\*.csv" dsd filename=fname;
path = fname;
input a b;
run;
Thank you!
Your code works well!
I didn't know filename option.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.