Hi,
I have 3 different programs, and I want to create a "program 0" that runs all the others programs. However, in the program 1, I want to run him to 36 different months, (i'm using a macro that change every month). Is it possible to run in program 0, 36 times one to each month? if yes, how?
Thank you.
Try this shell code and adjust it to your needs:
%macro program0(month);
%put ##&month.##;
/*
put code of your program here
*/
%mend;
%macro loop();
%do m = 1 %to 36;
%program0(&m.)
%end;
%mend;
%loop()
Bart
Try this shell code and adjust it to your needs:
%macro program0(month);
%put ##&month.##;
/*
put code of your program here
*/
%mend;
%macro loop();
%do m = 1 %to 36;
%program0(&m.)
%end;
%mend;
%loop()
Bart
@dmarques1998 wrote:
I have 3 different programs, and I want to create a "program 0" that runs all the others programs. However, in the program 1, I want to run him to 36 different months, (i'm using a macro that change every month). Is it possible to run in program 0, 36 times one to each month? if yes, how?
You could modify the macro to do the looping 36 times, or some arbitrary number of times that would be specified in the argument to the macro. You don't really need another macro to do this, although of course that works.
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.