Hi, I have problem on passing parm to a macro wish someone can give me a hand. Following is the script that I have. I am trying to pass parm to the macro using a do loop but it was not successful. Can anyone give me some advice. thanks. DATA rev_data; FORMAT rep_month $7. ; INPUT @1 rep_month $7.; CARDS; 2012-01 2012-02 2012-03 ; data rev_data; set rev_data; by rep_month; if first.rep_month then do; cnt = left(put(_n_,6.)); call symput('mth'||cnt, rep_month); call symput('mthcount', cnt); end; run; %put _user_; %macro a(m_mth, m_mthcount); %put month = &m_mth. count = &m_mthcount.; %mend; %a(&mth1, &mthcount); data _d_; do i = 1 to &mthcount; runmth = '&mth'||i; %a(&mth||i,i); end; run;
... View more