Hello SAS experts,
I have a list of datasets with the same name and variables structure, and I want to add them all in a single one.
this doesn't work:
data vzk_2020;
do i=1 to 8;
set vzk_2020_i;
end;
run;
what's the correct way?
regards,
PY
This is where you need a macro. You need one SET statement, but multiple datasets in it.
%macro dsnames; %do i = 1 %to 8; vzk_2020_&i. %end; %mend; data vzk_2020; set %dsnames ; run;
Take note where I placed semicolons, and where I omitted them.
View solution in original post
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!
Register now
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.