gpt4 book ai didi

sas - %str 和 %bquote 之间的宏 sas 差异

转载 作者:行者123 更新时间:2023-12-02 09:47:18 26 4
gpt4 key购买 nike

示例代码:-

%Let a = begin;

%let b1 = %str(&a);

%let b2 = %nrstr(&a);

%let b3 = %bquote(&a);

%let b4 = %nrbquote(&a);

%let b = end;

实际输出:-

b1 = begin 
b2 = &a
b3 = begin
b4 = begin

预期输出:-

b3 = end     
b4 = &a

这是因为 bquote 和 nrquote 是执行时间,而 str 和 nrstr 是编译时间吗?

最佳答案

如 SAS 手册 http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#z3514quote.htm 中所述,

%QUOTE and %NRQUOTE mask the same items as %STR and %NRSTR, respectively. However, %STR and %NRSTR mask constant text instead of a resolved value. And, %STR and %NRSTR work when a macro compiles, while %QUOTE and %NRQUOTE work when a macro executes.

关于sas - %str 和 %bquote 之间的宏 sas 差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27633531/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com