SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 772|回复: 0
打印 上一主题 下一主题

Call Execute

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2005-10-23 14:04:05 | 只看该作者

Call Execute

Foreword: Call execute is a function that can be used if you want to run some code based on the values of a dataset. In the example below the dataset test1 is only created if there is someone whose age = 100 in the dataset test:
[code:c445c]
data _null_;
set test;
if age=100 then do;
call execute("data test1;set test;run;");
stop;
end;
else stop;
run; [/code:c445c]

So in the example above the code that would be run if an age is =100 is:

[code:c445c]data _null_;
set test;
if age=100 then do;
call execute("data test1;set test;run;");
stop;
end;
else stop;
run;
data test1;
set test;
run; [/code:c445c]

Or a macro could be called:

[code:c445c]data _null_;
set test;
if age=100 then do;
call execute(%testmac);
stop;
end;
else stop;
run;[/code:c445c]
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-9 07:22 , Processed in 0.068798 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表