m****r 发帖数: 202 | 1 %macro place;
data _null_;
call symput('dept','sales');
run;
%let country=Germany;
%put _user_;
%mend;
%let company=ABC;
%place
请问为什么log中
GLOBAL DEPT sales ???
GLOBAL COMPANY ABC
a DATA step that contains a SYMPUT routine within a macro definition suppose
to create local macro variables
谢谢答复 |
a*****3 发帖数: 601 | 2 因为还在macro定义的domain之中吧? 可以试试跳出这个macro再来个 %put _user_. |
m****r 发帖数: 202 | 3 谢楼上,我加了一个%put _user_;在外面,结果还是
41 %put _user_;
GLOBAL DEPT sales
GLOBAL COMPANY ABC
而且问题中的%put _user_;是在macro 定义里的可log中就是显示
GLOBAL DEPT sales
GLOBAL COMPANY ABC |
a*****3 发帖数: 601 | 4 symput 应该产生global 还是local的?谁翻翻书。
反正
symputX(,,'G')产生global,
symputX(,,'L')产生local. |
m****r 发帖数: 202 | 5 Online Tutor
You can create a global macro variable with
* a %LET statement (used outside a macro definition)
* a DATA step that contains a SYMPUT routine
* a SELECT statement that contains an INTO clause in PROC SQL
* a %GLOBAL statement.
http://www.target-touch.com/admin/Ke8s3laOdN/60477/m52/m52_27.htm
You can create local macro variables with
* parameters in a macro definition
* a %LET statement within a macro definition
* a DATA step that contains a SYMPUT routine within a macro definition
* a SELECT statement that contains an INTO clause in PROC SQL within a
macro definition
* a %LOCAL statement.
http://www.target-touch.com/admin/Ke8s3laOdN/60477/m52/m52_29.htm |
a*****3 发帖数: 601 | 6 "a DATA step that contains a SYMPUT routine within a macro definition"
说的是macro定义在data步里面吧? 不适用于你的这个例子吧? |
m****r 发帖数: 202 | 7 data _null_;
call symput('dept','sales');
run;
我觉得这就是在data step里定义了一个 symput routine,
我的理解错误? |
l**********9 发帖数: 148 | |
m****r 发帖数: 202 | |
a*****3 发帖数: 601 | 10 那就给个伪币吧。
想想晚饭吃啥哩?
【在 m****r 的大作中提到】 : 感谢,感谢,非常感谢
|
l**********9 发帖数: 148 | |
m****r 发帖数: 202 | |