楼主: greatvia
3399 6

[原创博文] 如何判断一个宏变量是missing [推广有奖]

  • 0关注
  • 0粉丝

大专生

8%

还不是VIP/贵宾

-

威望
0
论坛币
24 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
379 点
帖子
36
精华
0
在线时间
45 小时
注册时间
2009-12-2
最后登录
2024-10-24

楼主
greatvia 发表于 2012-4-16 18:11:30 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我定义了一个宏变量, 我想判断它的值是不是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))
二维码

扫码加我 拉你入群

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

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

关键词:missing SSIN Miss ING Iss character function required cannot within

回帖推荐

jason_huo 发表于2楼  查看完整内容

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

沙发
jason_huo 发表于 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;

藤椅
chendonghui1987 发表于 2012-4-17 09:20:51
可以用

板凳
greatvia 发表于 2012-4-17 10:27:02
It works well.

THank you~

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

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

地板
bobguy 发表于 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?

7
greatvia 发表于 2012-4-23 14:53:08
I get a value and save it in a macro variable, so I need to make sure what value it contains.

%help = %sysfunc(getoption(SysIn));
By judging the value of %help is null or not I know if the program executed with interact mode or batch mode.

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 22:05