全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2038 2
2008-10-30

The thing I don't understand is why the marco variable proc is global instead of local to the marco one?

Thanks!

options mprint symbolgen;

mprint symbolgen;

%macro one;

data _null_;

call symput('proc', 'means');

run;

proc &proc data=sashelp.class;

run;

one;

data _null_;

call symput('proc', 'means');

run;

proc &proc data=sashelp.class;

run;

'proc', 'means');

run;

proc &proc data=sashelp.class;

run;

%mend;

%one

;

%one

%put _local_;

_local_;

%put _global_;

_global_;
二维码

扫码加我 拉你入群

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

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

全部回复
2008-10-30 15:23:00

不知道为什么上面的程序乱了。再贴一下。

options mprint symbolgen;

mprint symbolgen;

%macro one;

data _null_;

call symput('proc', 'means');

run;

proc &proc data=sashelp.class;

run;

one;

data _null_;

call symput('proc', 'means');

run;

proc &proc data=sashelp.class;

run;

'proc', 'means');

run;

proc &proc data=sashelp.class;

run;

%mend;

%one

;

%one

%put _local_;

_local_;

%put _global_;

_global_;
二维码

扫码加我 拉你入群

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

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

2008-10-30 15:43:00
自己想通了。Just the way it is.

The SYMPUT routine and the SYMPUTX routine can only create a local

macro variable if a local symbol table already exists.

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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