如何在 SAS Enterprise Guide 中列出所有可用的用户定义宏? [英] how to list all available user defined macros in SAS Enterprise Guide?
问题描述
在我的主代码中说我有这个代码块:
Say in my main code I have this code block:
%macros hi5;
%put hi five;
%mend;
%macros helloworld;
%put hello world;
%mend;
如何在 SAS Enterprise Guide 中显示类似的内容?(通过日志或通过 SAS 表)
How do I, in SAS Enterprise Guide, display something like this? (via log or via a SAS table)
These are the user defined user macros:
hi5
hello world
(目的是让用户能够知道他们已经可以使用哪些宏).
(the aim is so that user is able to know what macros are already available to them).
注意:%put _ALL_
仅列出所有宏变量,而不是宏(例如,使用 %macros 和 %mend
构建.)
Note: the %put _ALL_
only list all macros variables, not macros (e.g. built with %macros and %mend
.)
推荐答案
您可以通过 PROC CATALOG
或通过 dictionary.catalogs
到达那里.即使您不知道它们的存储位置,后者也可以工作.
You can get there via PROC CATALOG
, or via dictionary.catalogs
. The latter will work even if you don't know where they're stored.
proc sql;
select *
from dictionary.catalogs
where objtype='MACRO';
quit;
这将包括 SASHELP
中的预定义宏,您可以使用 where libname ne 'SASHELP'
将其排除.
That will include the predefined macros in SASHELP
, which you can exclude using where libname ne 'SASHELP'
.
这篇关于如何在 SAS Enterprise Guide 中列出所有可用的用户定义宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!