h*****e 发帖数: 187 | 1 想在一个macro里面再用一个macro不知道可行与否? |
x*****p 发帖数: 65 | |
D******n 发帖数: 2836 | 3 not good practice , but yes.
【在 h*****e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 想在一个macro里面再用一个macro不知道可行与否?
|
n**m 发帖数: 156 | 4 why "not good practice"
【在 D******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : not good practice , but yes.
|
c****o 发帖数: 69 | 5 why.....
looks like Im using this way a lot...
【在 D******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : not good practice , but yes.
|
D******n 发帖数: 2836 | 6 " Avoid Nested Macro Definitions
Nesting macro definitions inside other macros is usually unnecessary and
inefficient. When you call a macro that contains a nested macro
definition,
the macro processor generates the nested macro definition as text and
places
it on the input stack. The word scanner then scans the definition and
the
macro processor compiles it. If you nest the definition of a macro that
does
not change, you cause the macro processor to compile the same macro
each
time that section of the outer macro is executed.
As a rule, you should define macros separately. If you want to nest a
macro'
s scope, simply nest the macro call, not the macro definition."
--- SAS Macro Language Reference 9.2
But if u mean invoking another macro within a macro thats totally fine.
【在 c****o 的大作中提到】![](/moin_static193/solenoid/img/up.png) : why..... : looks like Im using this way a lot...
|
s*r 发帖数: 2757 | 7 这个是说nested definition不好吧
但没说不能再大macro里面call小macro吧
不过macro是个很奇怪的概念,与所有编程语言都不同
通常没事,不过出了bug常常是因为把它当成其他语言的function那么用
【在 D******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : " Avoid Nested Macro Definitions : Nesting macro definitions inside other macros is usually unnecessary and : inefficient. When you call a macro that contains a nested macro : definition, : the macro processor generates the nested macro definition as text and : places : it on the input stack. The word scanner then scans the definition and : the : macro processor compiles it. If you nest the definition of a macro that : does
|
n**m 发帖数: 156 | 8 got it.
【在 D******n 的大作中提到】![](/moin_static193/solenoid/img/up.png) : " Avoid Nested Macro Definitions : Nesting macro definitions inside other macros is usually unnecessary and : inefficient. When you call a macro that contains a nested macro : definition, : the macro processor generates the nested macro definition as text and : places : it on the input stack. The word scanner then scans the definition and : the : macro processor compiles it. If you nest the definition of a macro that : does
|