07-18-2014 03:27 PM
How do I pass the variable values into the macro? I have the following sample code. What I need is to print out the number of lines that is defined by 'times' in the 'test_data'. Thank you very much.
%do %while (&i<&finish);
%put the value of i is &i;
07-18-2014 04:48 PM
Or DOSUBL(), If you have SAS 9.3 M2 or later.
Please note, DOSUBL() is different from CALL EXECUTE(). The latter is done after the data step, while the DOSUBL() is done during the data step, so it is capable "PASS" a value back to data step literally.
07-18-2014 05:51 PM
Thank you for the reply. My original macro was actually a more complicated one. While debugging that macro, I encountered a problem involving passing variable values into macros during data step. Therefore, I created a simple sample for this question.