07-18-2013 03:58 PM
So I have this question about how to create a loop using macro.
There is a piece of code and I would like it t run 12 times with different start dates.
And so on and on,
How can I just make one piece of code and let it loop run from value.1 to value.12?
Thanks all for help!!
07-18-2013 04:47 PM
If the value is in a dataset then look up Call Execute to call the macro the each value of the variable in the dataset.
If you dates are SAS date value and you are using a ddmmmyy format to display them, you will likely want to create an actual character variable with the value using Put to simplify the call execute syntax.
A basic stub example:
call execute ('%fruitsales('||value||')');
Or the Call Execute could be within a do loop that sets value.