/*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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.