/*Read multiple txt files*/
/*Method One*/
filename t 'C:\Users\Anand\Desktop\Pandas_rawdata\multiplefilesforreading\*.txt' ;
data multi;
infile t;
input Name$ Sex$ Age $Height$ Weight$;
proc print;run;
/*Method Two*/
%macro import_multitext(fname);
proc import
datafile="C:\Users\Anand\Desktop\Pandas_rawdata\multiplefilesforreading/&fname..txt"
out=imptext.&fname.
dbms=tab
replace
;
run;
%mend;
%import_multitext(Class_1.txt);
Here I am trying to read text files at at time
I got problem in 1st method variables names also get two times
and 2nd method i didn't get output
> I got problem in 1st method variables names also get two times
I do not understand
> and 2nd method i didn't get output
Unsurprising.
%import_multitext(Class_1);
might work better.
If you want answers, provide information. What sort of reply is this?
This error message is not even accurate, and has nothing to do with the issue described so far.
Show us the log. Describe the problem. Provide the exact code used. Help us help you.
The message states the library NAME is not assigned.
This library is not used (or defined) in the code shown.
Please ask a question that we can answer by provide a single, comprehensive, version of what you are doing.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.