SAS:为什么 %include 不在日志中打印包含程序的注释?

SAS: Why does %include not print comments from the included program in the log?

我正在 运行使用 %include 为 main.sas 编写许多较小的 SAS 程序。我希望将所有较小程序中的注释打印到日志中,就像我 运行 每个程序单独打印一样。我似乎无法找到帮助我的选项(例如 mprint 仅适用于包含的程序)。我是 SAS 的新手,这可能是一个非常简单的问题,但我真的很着急。现在我们正在谈论它,任何人都可以帮助我了解输入和源之间的差异吗?我发现很难从 SAS 帮助页面获得帮助。

非常感谢! 基拉

简单。只需在主程序的开头添加 option source2; 即可。这告诉 SAS 将代码和注释打印到所有程序 运行 和 %include.

的日志中

SOURCESOURCE2选项控制SAS代码是否包含在日志中。这些通常默认为 SOURCENOSOURCE2。您可以更改 SOURCE2 系统选项,或将 /source2 选项添加到 %INCLUDE 语句。使用这个小程序生成几个带有 SAS 代码的示例文件。

filename file1 temp ;
filename file2 temp ;
data _null_;
  file file1 ;
  put '* This line is from FILE1;';
  file file2 ;
  put '* This line is from FILE2;';
run;

现在 %INCLUDE 使用和不使用 SOURCE2 选项。

%include file1 file2 ;
%include file1 file2 / source2 ;

这是日志的样子。

 71         %include file1 file2 ;
 74         %include file1 file2 / source2 ;
 NOTE: %INCLUDE (level 1) file FILE1 is file /tmp/SAS_workAEE90000185C_localhost.localdomain/#LN00050.
 75        +* This line is from FILE1;
 NOTE: %INCLUDE (level 1) ending.
 NOTE: %INCLUDE (level 1) file FILE2 is file /tmp/SAS_workAEE90000185C_localhost.localdomain/#LN00051.
 76        +* This line is from FILE2;
 NOTE: %INCLUDE (level 1) ending.
 77