楼主: qt600
2947 2

[求助] Global &Local symbol tables 的两道题 [推广有奖]

  • 0关注
  • 1粉丝

本科生

83%

还不是VIP/贵宾

-

威望
0
论坛币
5641 个
通用积分
0.9701
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1143 点
帖子
98
精华
0
在线时间
77 小时
注册时间
2007-2-25
最后登录
2023-9-11

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

56. The following SAS program is submitted:

%let a = cat;

%macro animal (a=frog);

%let a = bird;

%mend;

%animal (a=pig)

%put a is &a

 

Which one of the following is written to the SAS log?

 

  1. a is &a

  1. a is cat

  1. a is pig

  1. a is bird

Correct answer: b

 

Q30. the following SAS program is submitted:

%let a=apple;

%macro fruit;

%let a = orange;

%mend;

%fruit

%put a is &a;

 

Which one of the following is written to the SAS log?

 

  1. a is apple

  2. a is orange

  3. a is &a

  4. a is

Correct answer: b

请大家帮我看看这两道题的区别。谢谢。

二维码

扫码加我 拉你入群

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

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

关键词:symbol tables Global lobal Table 求助 Global tables Local symbol

回帖推荐

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

56.  程序先建一个gloabl 的变量a, 赋值cat;然后运行macro程序,建一个local macro 变量a ,赋值frog,因为最终调用了这个程序,所以local a 的值最终是pig.但是local macro 变量只在macro 程序中有效,所以macro 程序调用完之后,local a 会从local symbol table 中删除,所以最终只有global table中的a,她的值就是cat30. 和56不同,在complie macro 程序的时候,当读到%let a = orange;的时候,程序先到local symbol table 中 ...

本帖被以下文库推荐

沙发
olover 发表于 2008-4-18 13:15:00 |只看作者 |坛友微信交流群

56.  程序先建一个gloabl 的变量a, 赋值cat;然后运行macro程序,建一个local macro 变量a ,赋值frog,因为最终调用了这个程序,所以local a 的值最终是pig.但是local macro 变量只在macro 程序中有效,所以macro 程序调用完之后,local a 会从local symbol table 中删除,所以最终只有global table中的a,她的值就是cat

30. 和56不同,在complie macro 程序的时候,当读到%let a = orange;的时候,程序先到local symbol table 中去找local a,但是没有这个local变量;然后去global table 中去找,找到了有global macro a.所以就将它的值改成orange.

[此贴子已经被作者于2008-4-18 13:15:43编辑过]

已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 10 精彩帖子

总评分: 经验 + 3  论坛币 + 10   查看全部评分

使用道具

藤椅
qt600 发表于 2008-4-21 12:52:00 |只看作者 |坛友微信交流群
十分感谢。

使用道具

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

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

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

GMT+8, 2024-4-27 04:04