如何在 SAS Enterprise Guide 中列出所有可用的用户定义宏?

how to list all available user defined macros in SAS Enterprise Guide?

在我的主要代码中说我有这个代码块:

%macros hi5;
 %put hi five;
%mend;

%macros helloworld;
  %put hello world;
%mend;

我如何在 SAS Enterprise Guide 中显示这样的内容? (通过日志或通过 SAS table)

These are the user defined user macros:

hi5
hello world

(目的是让用户能够知道他们已经可以使用哪些宏)。

注意:%put _ALL_ 仅列出所有宏变量,而不是宏(例如使用 %macros and %mend 构建)

您可以通过 PROC CATALOGdictionary.catalogs 到达那里。即使您不知道它们的存储位置,后者也能正常工作。

proc sql;
  select * 
    from dictionary.catalogs
    where objtype='MACRO';
quit;

这将包括 SASHELP 中的预定义宏,您可以使用 where libname ne 'SASHELP' 将其排除。

当您 运行 SAS 使用 Enterprise Guide、SAS/Studio 或其他新奇特的访问方法时,以前出现在 WORK.SASMACR 目录中的已编译宏现在最终出现在 WORK.SASMAC1.至少在我探索过的环境中。

我正在使用 proc 目录

proc catalog cat=xxxxx.sasmacr;contents;run;