全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3830 3
2014-12-03
悬赏 30 个论坛币 未解决
如何在满足条件的时候中断程序文件的执行以及中断宏的执行,进入下一步




%macro a;


%if     %then %do;

中断宏a的执行
以及如何直接中断整个程序文件
以及如何跳转到某个程序语句

%end;

%mend
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2014-12-3 19:17:31
结束当前宏:%return;

中止SAS:%abort cancel;

跳转:%goto xxx;
定义为: %xxx:
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-12-3 22:00:40
Tigflanker 发表于 2014-12-3 19:17
结束当前宏:%return;

中止SAS:%abort cancel;
goto在宏中怎么用啊   没找到相关的例子
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-12-4 04:20:15
here is a sample about the goto statement.

%macro check(parm);
   %local status;
   %if &parm= %then %do;
       %put ERROR:  You must supply a parameter to macro CHECK.;
       %goto exit;
   %end;

  /* more macro statements that test for error conditions */

   %if &status > 0 %then %do;
       %put ERROR:  File is empty.;
       %goto exit;
   %end;

   /*more macro statements that generate text */

   %put Check completed successfully.;
%exit: %mend check;

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000209058.htm
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群