楼主: nkxhm
1212 4

[问答] 请教SAS ADV Macro一题 [推广有奖]

  • 0关注
  • 0粉丝

大专生

6%

还不是VIP/贵宾

-

威望
0
论坛币
0 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
522 点
帖子
22
精华
0
在线时间
43 小时
注册时间
2009-12-7
最后登录
2016-6-4

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
The following SAS program is submitted:
options yearcutoff = 1950;
%macro y2kopt(date);
%if &date >= 14610 %then %do;
options yearcutoff = 2000;
%end;
%else %do;
options yearcutoff = 1900;
%end;
%mend;
data _null_;
date = "01jan2000"d;
call symput("date",left(date));
run;
%y2kopt(&date)
The SAS date for January 1, 2000 is 14610 and the SAS system option for YEARCUTOFF is set to 1920 prior to submitting
the above program. Which one of the following is the value of YEARCUTOFF when the macro finishes execution?
答案是2000. 试了程序确实是对的。但是我有点困惑就是Macro不是都作为char var。除非用input 转换,不然怎么可以用来比大小呢?非常感谢! 祝大家新年快乐!

二维码

扫码加我 拉你入群

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

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

关键词:Macro acr CRO Mac yearcutoff execution following system option null

沙发
bridge1989 发表于 2015-2-18 18:42:05 |只看作者 |坛友微信交流群
http://blog.sina.com.cn/s/blog_726c67c50102uwr0.html

使用道具

藤椅
teqel 发表于 2015-2-20 08:42:41 |只看作者 |坛友微信交流群
在%if语句里面是例外,可以当数字比较大小

使用道具

板凳
nkxhm 发表于 2015-2-21 05:25:04 |只看作者 |坛友微信交流群
bridge1989 发表于 2015-2-18 18:42
http://blog.sina.com.cn/s/blog_726c67c50102uwr0.html
谢谢回复,但是我不是问yearcutoff的用法 二是%if macro 的处理

使用道具

报纸
nkxhm 发表于 2015-2-21 05:26:01 |只看作者 |坛友微信交流群
teqel 发表于 2015-2-20 08:42
在%if语句里面是例外,可以当数字比较大小
多谢回复,有依据吗? 没有搜到%if 介绍里有这项说明。

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-26 14:39