Hello,
I found some SAS code that retrieves all of the libraries and some of their associated SAS metadata. I would like to expand this code to retrieve each library's table metadata. It seems like for each library a loop is needed to find the number of tables in the library, then for each table retrieve the description, the folder and so forth.
Any suggestions?
Thank you.
JOIN between the appropriate tables should work in SQL instead of looping.
One question is which "table metadata" that you want.
The table metadata I want, to start with, is the Name, Description, Location, and actual physical table name. As shown in SAS Management Console.
Try this:
proc sql;
create table Tables as
select T.libname
,T.memname
,T.memlabel
,L.path
,L.sysdesc
from dictionary.tables as T,
dictionary.libnames as L
where upcase(memname) = 'ODSSTYLE'
and T.libname = 'STPSAMP'
and T.libname = L.libname
;
quit;
I believe the code and screenshot the OP shared makes it obvious that this is about querying SAS metadata and SAS Metadata Tables and not the SAS dictionary.
@figureItOut : Yes, you would need to implement some sort of loop logic per metadata library definition. I haven't checked but would assume tables are associations for libraries.
I normally use the SAS Windows Manager and then metabrowse to figure out how things "hang together" in SAS Metadata.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.