我有以下代码,我试图从宏生成一个独立的代码(写入外部sas文件)。但是,默认情况下,会生成完整的代码并将其写入外部文件。我想知道是否有一种方法可以控制宏的哪些部分被写入外部文件。谢谢你对我的帮助。
%macro tempmacro(outds=);
/* I dont want this following code to be printed */
proc sql noprint;
SELECT cats(name,"=",substr(name,2))
INTO :renames SEPARATED BY " "
FROM dictionary.columns
WHERE LIBNAME="SASHELP" AND MEMNAME=upcase('BASEBALL');
quit;
/* I only Want this following data step printed to the external file */
data &outds;
set sashelp.baseball;
rename &renames;
run;
%mend;
options mfile mprint;
filename mprint "D:\test_code.sas";
data _null_;
file mprint;
%tempmacro(outds=data1);
options nomfile nomprint;
run;