SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 776|回复: 2
打印 上一主题 下一主题

a Gobal vs. Local Symbol Table question..

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 2011-3-10 08:30:55 | 只看该作者

a Gobal vs. Local Symbol Table question..

This is from one of the questions discussed. But I am still a bit confused:

%macro loop1 (input);
        %put date1 is &DATE;
        %loop2;
        %put date2 is &DATE;
%mend;

%macro loop2;
        data _NULL_;
                call symput('DATE', '28SEP1998');
                %put date3 is &DATE;
        run;
%mend;

%let DATE=31DEC2006;
%put date4 is &DATE;

%loop1(&DATE)
%put date5 is &DATE;


Here is the output:
date1 is 31DEC2006
date2 is 28SEP1998
date3 is 31DEC2006
date4 is 31DEC2006
date5 is 28SEP1998

I dont get why date3 and date5 are 31DEC2006 and 28SEP1998. Any helps, please??

Thanks!
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
沙发
 楼主| 发表于 2011-3-10 14:57:49 | 只看该作者

Re: a Gobal vs. Local Symbol Table question..

<!-- m --><a class="postlink" href="http://saslist.com/hssnow/2011/02/09/sas-macro-symbol-table-1/">http://saslist.com/hssnow/2011/02/09/sa ... l-table-1/</a><!-- m -->
回复 支持 反对

使用道具 举报

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
板凳
 楼主| 发表于 2011-3-11 05:10:52 | 只看该作者

Re: a Gobal vs. Local Symbol Table question..

This is very detailed and helpful! Thanks!

(I learned not only the difference, but their Chinese translation!)
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2025-6-11 10:41 , Processed in 0.068833 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表