全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1678 4
2013-12-08
代码如下:
复制代码
Log:
MPRINT(MACRO_FORMAT):   proc format;
WARNING: Apparent symbolic reference M not resolved.
MPRINT(MACRO_FORMAT):   value $gencode "M22" = "H&M (Shop)" other = "Unknown" ;
NOTE: Format $GENCODE is already on the library.
NOTE: Format $GENCODE has been output.

怎么样才可以不出桔黄色的Warning?试了各种%str,%nrstr,%nrbquote,不知道怎么正确使用才能不出warning。
二维码

扫码加我 拉你入群

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

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

全部回复
2013-12-8 20:29:53
好高深
二维码

扫码加我 拉你入群

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

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

2013-12-8 20:46:24
这个不就是做FORMAT吗?你直接用DATA 步做也是一样的,
data code;
input LABEL $3. START $20.;
FMTNAME="$SEARCH";
cards;
M22 H&M (Shop)
;
run;

PROC FORMAT CNTLIN=CODE;
RUN;
二维码

扫码加我 拉你入群

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

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

2013-12-9 03:23:59
The macro quoting part is the most difficult in learning SAS macros. In this case you need a %superq quoting function as below.

The %superq quoting function masks all special characters and mnemonic operators at macro execution but prevents further resolution of the value.

Please note the argument form is slightly different (&&gdesc&i --> gdesc&i).

507
508      %macro macro_format;
509      proc format;
510      value  $gencode
511          %do i=1 %to &numgenp.;
512          "&&code&i" = "%superq(gdesc&i)"
513         %end;
514         other   = "Unknown"
515         ;
516         run;
517      %mend macro_format;
518
519      
520      %macro_format;
MPRINT(MACRO_FORMAT):   proc format;
MPRINT(MACRO_FORMAT):   value $gencode "M22" = "H&M (Shop)" other = "Unknown" ;
NOTE: Format $GENCODE is already on the library.
NOTE: Format $GENCODE has been output.
MPRINT(MACRO_FORMAT):   run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
二维码

扫码加我 拉你入群

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

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

2013-12-9 09:32:04
bobguy 发表于 2013-12-9 03:23
The macro quoting part is the most difficult in learning SAS macros. In this case you need a %superq ...
Thank you so much. I spent almost 10 hours to fix this. Thank you so so much!! This forum is amazing~~
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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