I know it's been more than a year, but this might still help someone so here goes. Setting aside questions of whether to pre-compile macros or not, the second example of OP's code will work with one small change: proc sql;
select *
from dictionary.catalogs
where objtype='MACRO' and libname='mylib';
quit; In dictionary.catalogs, libnames are all caps, and this is a case sensitive match. Change the where clause to: where objtype='MACRO' and libname='MYLIB'; and you'll get the desired listing of your saved macros.
... View more