I'm trying to get started using SAS. I create a dataset in which the number of variables is dependent on the period chosen by a user. What I want to do is loop trough these variables. The macro I'm trying to use for this is (I justed fixed date for the example):
%MACRO DO_PERIOD;
%DO I = 1 %TO %SYSFUNC(intck('month', "01JUL2008"d, "31JUL2009"d));
%PUT %I
%END;
%MEND DO_PERIOD;
Unfortunately running this macro yields the following error:
ERROR: A character operand was found in the %EVAL function or %IF
condition where a numeric operand is required.
The condition was: %sysfunc(intck('month', "01JUL2008"d, "31JUL2009"d))
ERROR: The %TO value of the %DO I loop is invalid.
ERROR: The macro DO_PERIOD will stop executing.
I tried numerous ways of evaluating the intck function (e.g. %eval(%sysfunc(....)), using input(...)), but without any results. I hope someone of you knows the answer to evaluating a function in a %do statement.