Help using Base SAS procedures

Number of components in a library

Reply
Contributor
Posts: 74

Number of components in a library

Hi ,

I have a library that has, say for example 'n' number of sas datasets.Is there any way I can get the exact count of the sas data sets in the library.

Please help.

Ren
SAS Super FREQ
Posts: 8,864

Re: Number of components in a library

Hi:
There have been a LOT of previous forum postings on the use of DICTIONARY.TABLES or the "dictionary" information that is maintained by SAS. Another "view" of the dictionary files are the SASHELP.Vxxx files -- SASHELP.VCOLUMNS, SASHELP.VTABLES, etc.
There are also a lot of user group papers on these topics with very good examples about how to use the meta-information in these files to help you manage your libraries and write data-driven programs.
I recommend that you search the forum postings on the terms
dictionary.tables or sashelp tables

and you should find some useful hits.

cynthia
Contributor
Posts: 74

Re: Number of components in a library

Posted in reply to Cynthia_sas
I tried the following but NO ROWS SELECTED

proc sql;

select *
from dictionary.tables
where upcase(libname)='aa';
quit;

aa is my library where I have 'n' number of sas datasets.
Super Contributor
Super Contributor
Posts: 3,174

Re: Number of components in a library

Check your WHERE clause - you UPCASE the variable but you specify a lower-case constant value..... Also, your code presumes you have a prior LIBNAME defined with a libref of "AA".

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 74

Re: Number of components in a library

I tried the following,still did not work,says NO ROWS SELECTED

libname Aa 'O:\nnb_O\roms\quarter';
proc sql;

select *
from dictionary.tables
where libname='Aa';
quit;
Super Contributor
Super Contributor
Posts: 3,174

Re: Number of components in a library

Suggest you desk-check the program by removing the WHERE.

Scott Barry
SBBWorks, Inc.
Trusted Advisor
Posts: 2,115

Re: Number of components in a library

LIBNAMES are stored internally to SAS as UPPER CASE. So Aa, aa, and AA are all the same library, AA. See the note in your log.
Ask a Question
Discussion stats
  • 6 replies
  • 113 views
  • 0 likes
  • 4 in conversation