Reputation: 787
I am working with sas, and I have a program I have made I want to run on a series of databases which are indexed by 01, 02 until 95 in characters ! (they correspond to different geographical areas). I have created my program and would like to use a %lanc macro, but I would like to know if there is a better way thant
%lanc(area=01)
%lanc(area=02)
...
%lanc(area=95)
My problem is therefore
Thanks
Upvotes: 0
Views: 401
Reputation: 7769
Have a macro loop, create a copy of the loop counter but formatted to z2., then pass that into your macro call...
%MACRO LOOPER ; %DO LN = 1 %TO 95 ; %LET Z2 = %SYSFUNC(putn(&LN,z2.)) ; /* format &LN in z2. */ %LANC(AREA=&Z2) ; %END ; %MEND ; %LOOPER ;
Upvotes: 2