looping through arguments in a macros in sas -
i have developed sas code has macro 2 arguments. macro looks this
%macro compare(country,attributes)
the problem have 10 countries , example india, u.s.a, australia, pakistan etc , 15 attributes such language, area, currency, life_expec, malefemaleratio etc.
so have call macro 150 times.
%compare(india,language); %compare(india,area); %compare(india,currency); * ; /* have same other attributes */ * ; %compare(u.s.a,language) %compare(u.s.a,area) /* have same other countries */ *; *; *;
is there way take take these attributes , country names array , loop through them same result? new sas. in advance helping me
i suggest 1. put country , attributes sas table 'country_attr', variable 'country' , 'attributes'. 2. call execute:
data _null_; set country_attr; call execute ('%compare('||country||','||attributes')'); run;
Comments
Post a Comment