全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3337 6
2012-04-16
我定义了一个宏变量, 我想判断它的值是不是missing
有没有类似于missing() 函数的宏函数呢?
我试了
%let help =XXXXX;

%if %sysfunc(missing(&help)) %then %do;

Error输出:
ERROR: The function MISSING referenced by %SYSFUNC, %QSYSFUNC, or %SYSCALL cannot be used within
       the MACRO function/call-routine interfaces.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric
       operand is required. The condition was: %sysfunc(missing(&help))
二维码

扫码加我 拉你入群

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

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

全部回复
2012-4-16 18:44:29
%let help =xxxx;

%macro test();
%if &help= %then %do;
        %put missing;
        %end;
%else %do;
        %put not missing;
        %end;
%mend ;

%test;
二维码

扫码加我 拉你入群

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

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

2012-4-17 09:20:51
可以用
二维码

扫码加我 拉你入群

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

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

2012-4-17 10:27:02
It works well.

THank you~
二维码

扫码加我 拉你入群

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

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

2012-4-17 15:09:44
greatvia 发表于 2012-4-17 10:27
It works well.

THank you~
SAS 宏在处理判断字符的时候确实有些麻烦,但先测试一下就好了
二维码

扫码加我 拉你入群

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

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

2012-4-19 08:51:11
What do you mean the value of a macro variable is missing? A defined macro variable with <space>? or undefined macro variable?
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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