Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 SAS 上,在定义了 Macro Language 之后,例如,
%macro source(x); ...... %mend source;
我想用 x 代替 17 到 63,有没有一种简单的方法可以代替键入
%source(16); %source(17); ... %source(63);
您可以创建一个带有 do-statement 的新宏来运行您的宏选择次数:
%MACRO RunMacro(from, to); %DO i = &from. %TO &to.; %source(&i.); %END; %MEND RunMacro; %RunMacro(16, 63);