楼主: wodematlab
1252 5

[原创博文] sas宏的问题 [推广有奖]

  • 6关注
  • 7粉丝

已卖:703份资源

教授

2%

还不是VIP/贵宾

-

威望
0
论坛币
1910 个
通用积分
14.0137
学术水平
12 点
热心指数
19 点
信用等级
10 点
经验
10670 点
帖子
1063
精华
0
在线时间
972 小时
注册时间
2008-4-19
最后登录
2024-7-11

楼主
wodematlab 发表于 2012-6-27 08:59:37 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
%macro prtlast;
%if &syslast ne _NULL_ %then %do;
proc print data=&syslast(obs=5);
title "Listing of &syslast data set";
run;
%end;
%else
%put No data set has been created yet.;
%mend;
proc sort data=sasuser.courses out=bydays;
by days;
run;
%prtlast

为什么在Advanced Programming 那本书里面%prtlast后面为什么可以不加分号
二维码

扫码加我 拉你入群

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

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

关键词:SAS宏 Programming Advanced created Program created title

沙发
juneandvictor 发表于 2012-6-28 01:37:31
During execution, macro PRTLAST will be replaced by:
if &syslast ne _NULL_ then do;
proc print data=&syslast(obs=5);
title "Listing of &syslast data set";
run;
end;
else
put No data set has been created yet.;

SO: 可以不加分号. If you did add the semicolon, it doesn't matter. Just like: put No data set has been created yet.;;

藤椅
kunkunred 发表于 2012-6-28 02:23:09
You are quoting the macro. So it doesn't matter if there is a ";"

板凳
wodematlab 发表于 2012-6-28 23:11:27
thank you!!

报纸
bobguy 发表于 2012-6-29 06:53:21
juneandvictor 发表于 2012-6-28 01:37
During execution, macro PRTLAST will be replaced by:
if &syslast ne _NULL_ then do;
proc print dat ...
Sometime it matters but not in this one. Remember ';' is valid statement named null statement.

For example, an additional ';' may end if ... then...;, else if .. then ...; block unintentionally.

Following the language syntaxes or rules will makes program robust.

地板
iaujin 发表于 2012-7-4 23:15:17
agree with bobguy

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

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