楼主: 小鳄鱼a
3882 3

如何中断 [推广有奖]

  • 6关注
  • 10粉丝

已卖:280份资源

学科带头人

3%

还不是VIP/贵宾

-

威望
0
论坛币
125 个
通用积分
0.0040
学术水平
40 点
热心指数
45 点
信用等级
43 点
经验
32801 点
帖子
1185
精华
0
在线时间
1539 小时
注册时间
2009-7-16
最后登录
2018-10-5

楼主
小鳄鱼a 发表于 2014-12-3 18:53:30 |AI写论文
30论坛币
如何在满足条件的时候中断程序文件的执行以及中断宏的执行,进入下一步




%macro a;


%if     %then %do;

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

%end;

%mend

关键词:Macro Then End 下一步 The 如何

沙发
Tigflanker 发表于 2014-12-3 19:17:31
结束当前宏:%return;

中止SAS:%abort cancel;

跳转:%goto xxx;
定义为: %xxx:

藤椅
小鳄鱼a 发表于 2014-12-3 22:00:40
Tigflanker 发表于 2014-12-3 19:17
结束当前宏:%return;

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

板凳
bullstag 发表于 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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 11:54