全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
13234 10
2011-12-10
最近看SAS程序,碰到SAS的宏引用函数,总是弄不明白。

特别是%nrstr, %nrbquote和%superq这三个函数之间的区别。

SAS官网说%nrstr是在compile时mask, %nrbquote是在execute时mask,不清楚是在说什么

请各位帮忙解惑,若有例子最好

二维码

扫码加我 拉你入群

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

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

全部回复
2011-12-10 11:48:35
SAS帮助文档是这么说的,

  • %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.

谁能解释一下第二点究竟是什么意思


二维码

扫码加我 拉你入群

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

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

2011-12-11 01:47:42
有点意思。。。
二维码

扫码加我 拉你入群

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

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

2011-12-11 16:42:59
The macro language provides an additional set of tools to assist in:
  • communicating between SAS steps,
  • constructing executable and reusable code,
  • designing custom languages,
  • developing user-friendly routines,
  • conditionally execute DATA or PROC steps.

It is worth mentioning that during macro compilation only macro statements are compiled, so be aware that non-macro
text and macro references are not evaluated during the compilation phase – but during macro execution .

When one macro is invoked, the SAS code is generated. This time is called macro execution time.
It is intertwined with the compiling (or parsing) of the generated SAS code. Finally there is the SAS execution time when the compiled code is executed. Thus the are four important times or stages through which the lines of a SAS program with
macros move.
1. Macro compile time
2. Macro execution time
3. SAS compile time
4. SAS execution time
Typically these times are all intertwined and going on, at the same time for different lines (or parts of lines).

%LET NAME=USERFILE.MASTER;
请问各位:这个%let语句是不是也分compile 和 execute两个阶段处理?

二维码

扫码加我 拉你入群

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

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

2012-11-1 04:39:47
受教了,谢谢!
二维码

扫码加我 拉你入群

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

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

2014-12-28 11:09:08
同问啊。。。所以这个帖没有答案么。。。
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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