Hello
I have a macro called RRR
%Macro RRR(V_months);
code here
%mend RRR;
Usually I run the macro by typing the months as you see here
%RRR_STEP1(V_months=2211+2210+2209+2208+2207+2206)
%RRR_STEP1(V_months=2210+2209+2208+2207+2206+2205)
%RRR_STEP1(V_months=2209+2208+2207+2206+2205+2204)
%RRR_STEP1(V_months=2208+2207+2206+2205+2204+2203)
%RRR_STEP1(V_months=2207+2206+2205+2204+2203+2202)
%RRR_STEP1(V_months=2206+2205+2204+2203+2202+2201)
%RRR_STEP1(V_months=2205+2204+2203+2202+2201+2112)
%RRR_STEP1(V_months=2204+2203+2202+2201+2112+2111)
%RRR_STEP1(V_months=2203+2202+2201+2112+2111+2110)
%RRR_STEP1(V_months=2202+2201+2112+2111+2110+2109)
%RRR_STEP1(V_months=2201+2112+2111+2110+2109+2108)
%RRR_STEP1(V_months=2112+2111+2110+2109+2108+2107)
But it is not so comfortable to type so many dates manually.
Let's say that there is a macro var called Vector_CAT that automatically calculate the macro dates that need to run.
In this case this macro var get value : 2306+2305+2304+2303+2302+2301,2307+2306+2305+2304+2303+2302,2308+2307+2306+2305+2304+2303,2309+2308+2307+2306+2305+2304,2310+2309+23 08+2307+2306+2305
I want to run the macro multiple times
I try this code but I am not sure it is correct.
What do you think?
is it correct?
Why should I write the delimiter (comma) like this : %str(,) ?
Is there another good way to run the macro automatically from the macro varaible components?
%macro run_step1;
%do i=1 %to &n_run_step1;
%let mm = %scan(%quote(&Vector_CAT), &i, %str(,));
%RRR_STEP1(&mm);
%end;
%mend run_step1;
%run_step1;
... View more