Hi,
I am trying to figure out why below mentioned code is not working (problem occurs at out= statement, when I set out=a by hard, it works but creates just one file clearly...):
%let list_of_names = first second third;
%macro _loop();
%do i = 1 %to 4/*%sysfunc(countw(&list_of_names))*/;
proc import datafile = "\\someAddress\%scan(&list_of_names, &i).csv"
out=%scan(&list_of_names, &i)
dbms=csv
replace;
getnames=yes;
run;
%end;
%mend _loop;
%_loop();Thanks for your suggestions!
That's a good line of thought, implementing it would be even simpler than what you tried:
out=_%scan(&list_of_names, &I)
Hi, yes, here I am posting a picture of the error returned:
I assume its problem is a string dsn starting with int..looks like I will have to rename it in some way, otherwise there is some other option...?
This also did not work:
out='_'||%scan(&list_of_names, &i)
That's a good line of thought, implementing it would be even simpler than what you tried:
out=_%scan(&list_of_names, &I)
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.