dev*_*von 2 loops sas sas-macro
所以我想为我的宏函数运行嵌套循环.这是我的代码,看起来SAS不喜欢by -1.无论如何,我编码这个让第二个循环减少步骤-1?在这种情况下,我yearMix = 1982和yearMax = 1994.
%Macro theLoop;
%Do I = &yearMin+1 %to &YearMax-1;
%Do J = &YearMax-1 %to &I by -1;
%Meaw;
%END;
%END;
%MEND theLoop;
%theLoop;
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误:
错误:在%EVAL函数或%IF条件中找到了一个字符操作数,其中需要一个数字操作数.条件是:&I by -1
ERROR:%DO J循环的%TO值无效.
错误:宏THELOOP将停止执行.