Hi all,
I have 5 datasets (Cohort1, Cohort2, Cohort3...).
I have a long program with a macro variable &DATA whenever I am calling one of the datasets above.
Is there a way to write a do loop that will run my entire program on all the cohorts?
Hi,
something like this maybe?
%macro cohort;
%do i=1 %to 5;
data cohort&i;
infile or set statement here, and you can add &var to create variable different for each year;
.....
run;
%end;
/*you can insert your second macro here that will run for each cohort separately*/
%mendcohort;
%cohort;
April 27 - 30 | GAYLORD TEXAN
Register now to lock in early bird pricing through February 25!
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.
Browse our catalog!