SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

Is there a way in Enterprise Guide to View the metadata of a Library?  I'm to printout a list of tables in a library and then tables with column details.  Then I will compare that list with that of a similar library on another server.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

If you are willing to write a program rather than point-and-click, you can use:

 

proc contents data=lib._all_;
run;

View solution in original post

7 REPLIES 7
Astounding
PROC Star

If you are willing to write a program rather than point-and-click, you can use:

 

proc contents data=lib._all_;
run;
DavidPhillips2
Rhodochrosite | Level 12

I ran into a lot of errors like:

 

ERROR: File schemaname.tablename1.DATA does not exist.

 

Do I need to do something before I can run:

proc contents data=lib._all_;
run;

 

Astounding
PROC Star

Are you working with SAS data sets?

 

Do you have a LIBNAME statement in the program to refer to the folder that contains those data sets?

DavidPhillips2
Rhodochrosite | Level 12
libname demo meta library='Demo1';

proc contents data=demo. _all_;
run;
Tom
Super User Tom
Super User

Assuming that you didn't actually include the space between the period and the _ALL_ then any errors you are getting is because of errors in the library that you connected to.  You probably need to contact your local SAS administrator see why you are getting errors using that library.

data_null__
Jade | Level 19

@Tom wrote:

Assuming that you didn't actually include the space between the period and the _ALL_ 


 

The space does not cause syntax error.

 

35         proc contents data=work. _all_ noprint out=contents;
36            run;

NOTE: The data set WORK.CONTENTS has 47 observations and 41 variables.
SASKiwi
PROC Star

@DavidPhillips2  - I suspect that using PROC CONTENTS against a SAS library using the META engine will only work if the library has tables that are actually registered in SAS metadata - if it will work at all. There is also no guarantee that the registered table definition will match the actual table definition. So I guess it depends what you want to do here. Review the tables as stored on disk or how they are defined in SAS metadata.

 

 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1817 views
  • 1 like
  • 5 in conversation