如何在《 SAS企业指南》中列出所有可用的用户定义的宏? [英] 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企业指南》中显示类似的内容? (通过日志或通过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 and %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企业指南》中列出所有可用的用户定义的宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!