在 SAS 数据步骤之外停止语句?
Stop statement outside a SAS data step?
我不是在开发时对大块代码进行注释,而是在数据步骤外寻找与 stop
语句等效的语句,它在某个点停止 SAS 脚本,理想情况下不会抛出错误,也没有设置括号,也没有定义自己的宏。我发现的最小解决方法如下所示:
%put --- This is code I would like to execute;
data _null_;
abort cancel file;
run;
%put --- This is code which should temporarily disabled;
是否有更短或更清晰的解决方案(就日志输出而言)如何在不完全退出 SAS 的情况下停止执行 SAS 脚本?
相关问题
- Ending a SAS-Stored process properly 启发了我的示例代码。
- break/exit script 是关于一个稍微不同的问题
创建一个宏stop_submission
%macro stop_submission;
%abort cancel;
%mend;
示例使用:
%macro stop_submission;
%abort cancel;
%mend;
data one;
set sashelp.class;
run;
%stop_submission
data two;
set sashelp.class;
run;
data three;
set sashelp.class;
run;
会记录类似
的内容
29167 data one;
29168 set sashelp.class;
29169 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.ONE has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
29170
29171 %stop_submission
ERROR: Execution canceled by an %ABORT CANCEL statement.
NOTE: The SAS System stopped processing due to receiving a CANCEL request.
我不是在开发时对大块代码进行注释,而是在数据步骤外寻找与 stop
语句等效的语句,它在某个点停止 SAS 脚本,理想情况下不会抛出错误,也没有设置括号,也没有定义自己的宏。我发现的最小解决方法如下所示:
%put --- This is code I would like to execute;
data _null_;
abort cancel file;
run;
%put --- This is code which should temporarily disabled;
是否有更短或更清晰的解决方案(就日志输出而言)如何在不完全退出 SAS 的情况下停止执行 SAS 脚本?
相关问题
- Ending a SAS-Stored process properly 启发了我的示例代码。
- break/exit script 是关于一个稍微不同的问题
创建一个宏stop_submission
%macro stop_submission;
%abort cancel;
%mend;
示例使用:
%macro stop_submission;
%abort cancel;
%mend;
data one;
set sashelp.class;
run;
%stop_submission
data two;
set sashelp.class;
run;
data three;
set sashelp.class;
run;
会记录类似
的内容29167 data one;
29168 set sashelp.class;
29169 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.ONE has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
29170
29171 %stop_submission
ERROR: Execution canceled by an %ABORT CANCEL statement.
NOTE: The SAS System stopped processing due to receiving a CANCEL request.