DATA Step, Macro, Functions and more

How to - Display Number of Observations of Databases in a Library

Reply
Super Contributor
Posts: 381

How to - Display Number of Observations of Databases in a Library

Hello everyone,

 

I would like to display whole databases number of observations in a library. I have a method as below but I'm looking for other methods. I just wonder that, is it possible to show number of observations by using Proc Datasets or Proc Content or any other methods which is different from following one?

 

Here is my method;

 

proc sql;
select memname,nobs
from dictionary.tables
where libname eq 'SASHELP'
quit;

 

Actually, this code works for many libraries, however, when I try to use some other libraries which are larger data sets, does not work and I get the following error. 

 

ERROR: Error on server LIBNAME socket.

 

The foregoing Error can be related to size of library or the reason is completely different?

 

Thank you

Super User
Super User
Posts: 7,392

Re: How to - Display Number of Observations of Databases in a Library

This sounds to me like your connecting to a database or a server somewhere, and its is trying to get the information back from there.  However no information is provided in your post so can't say.  I would check with your IT group/SAS IT group to see what is connected and what is causing the problem, maybe you have a DB connection but you don't have the correct accesses.

Super User
Posts: 10,476

Re: How to - Display Number of Observations of Databases in a Library

If your Library on the server is another database then the metadata SAS maintains on its datasets may not be available and you may have to explicitly query the database specific tools for that information.

Super Contributor
Posts: 381

Re: How to - Display Number of Observations of Databases in a Library

Hello,

 

Thank you for your responses.

 

I would like to state that whole libraries are in the same server, the code works for many libraries but doesn't work for some of them. 

When I first click the icon->(+) I can see the data sets under the library, but after I execute the code and then click the icon ->(+) I see nothing under the library.

 

Do you have additional thought about this case? And any other codes to see number of observations?

 

Thank you

Ask a Question
Discussion stats
  • 3 replies
  • 205 views
  • 0 likes
  • 3 in conversation