楼主: zjfccb
2283 2

[SAS] 请教一个关于Macro的题目 [推广有奖]

  • 0关注
  • 1粉丝

小学生

92%

还不是VIP/贵宾

-

威望
0 级
论坛币
314 个
通用积分
2.3433
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
196 点
帖子
16
精华
0
在线时间
1 小时
注册时间
2007-7-13
最后登录
2016-9-26

楼主
zjfccb 发表于 2008-10-30 15:18:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
<font face="Courier New" color="#0000ff" size="2"><p>The thing I don't understand is why the marco variable proc is global instead of local to the marco one?</p><p>Thanks!</p><p>options<font face="Courier New" size="2"> mprint symbolgen;</font></p></font><font face="Courier New" size="2"> mprint symbolgen;</font><b><font face="Courier New" color="#000080" size="2"><p>%macro<font face="Courier New" size="2">
                                        <b><i>one</i></b>;<p>data _null_;</p><p>call symput(<font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font></p></font></p></font></b><font face="Courier New" size="2">
                <b><i>one</i></b>;<p>data _null_;</p><p>call symput(<font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font></p></font><font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font><b><font face="Courier New" color="#000080" size="2"><p>%mend<font face="Courier New" size="2">;<p>%<b><i>one</i></b></p></font></p></font></b><font face="Courier New" size="2">;<p>%<b><i>one</i></b></p></font><font face="Courier New" color="#0000ff" size="2"><p>%put<font face="Courier New" size="2"> _local_;</font></p></font><font face="Courier New" size="2"> _local_;</font><font face="Courier New" color="#0000ff" size="2"><p>%put<font face="Courier New" size="2"> _global_;</font></p></font><font face="Courier New" size="2"> _global_;</font>
二维码

扫码加我 拉你入群

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

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

关键词:Macro acr CRO Mac Understand 请教 题目 Macro

沙发
zjfccb 发表于 2008-10-30 15:23:00
<font face="Courier New" color="#0000ff" size="2"><p>不知道为什么上面的程序乱了。再贴一下。</p><p>options<font face="Courier New" size="2"> mprint symbolgen;</font></p></font><font face="Courier New" size="2"> mprint symbolgen;</font><b><font face="Courier New" color="#000080" size="2"><p>%macro<font face="Courier New" size="2">
                                        <b><i>one</i></b>;<p>data _null_;</p><p>call symput(<font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font></p></font></p></font></b><font face="Courier New" size="2">
                <b><i>one</i></b>;<p>data _null_;</p><p>call symput(<font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font></p></font><font face="Courier New" color="#800080" size="2">'proc'</font><font face="Courier New" size="2">, </font><font face="Courier New" color="#800080" size="2">'means'</font><font face="Courier New" size="2">);<p>run;</p><p>proc &amp;proc data=sashelp.class;</p><p>run;</p></font><b><font face="Courier New" color="#000080" size="2"><p>%mend<font face="Courier New" size="2">;<p>%<b><i>one</i></b></p></font></p></font></b><font face="Courier New" size="2">;<p>%<b><i>one</i></b></p></font><font face="Courier New" color="#0000ff" size="2"><p>%put<font face="Courier New" size="2"> _local_;</font></p></font><font face="Courier New" size="2"> _local_;</font><font face="Courier New" color="#0000ff" size="2"><p>%put<font face="Courier New" size="2"> _global_;</font></p></font><font face="Courier New" size="2"> _global_;</font>

藤椅
zjfccb 发表于 2008-10-30 15:43:00
自己想通了。<font face="Times New Roman" size="1">Just the way it is. </font><font face="NewCenturySchlbk-Roman"><p align="left"><font face="Times New Roman" size="1">The SYMPUT routine and the SYMPUTX routine can only create a local</font></p><p><font face="Times New Roman" size="1">macro variable if a local symbol table already exists.</font></p></font>

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

客服
GMT+8, 2026-12-1 06:07