let me first point out that I am new to SAS.
I have a library with a certain amount of data sets in it.
This library is not SAS native but is connected to SAS Server via an ODBC driver. Let’s call this library extlib
.
I want to get an output data set containing the number of observations for each data set in the extlib
library. In other words an output that looks like this:
libname |
memname |
nobs |
---|---|---|
extlib | tabA | 1000 |
extlib | tabB | 2000 |
extlib | tabC | 0 |
extlib | tabD | 1500 |
I learnt that for ‘normal’ libraries ie libraries hosted in a SAS DBMS, obtaining such table is rather easy, as you can find it in sashelp.vtable
if you run something like this:
DATA want;
SET sashelp.vtable (WHERE=(libname="EXTLIB") KEEP=libname memname nobs);
RUN;
The problem is when I run this specifically filtering on extlib
I get this result:
libname |
memname |
nobs |
---|---|---|
extlib | tabA | . |
extlib | tabB | . |
extlib | tabC | . |
extlib | tabD | . |
while other data sets in other libraries do have a value in for nobs
in sashelp.vtable
.
I suspect the fact the library comes from a foreign source is at stake in this issue.
When I run:
PROC SQL;
SELECT COUNT(*) AS nobs FROM extlib.tabA;
QUIT;
I get my info for a specific table.
The issue is I have a huge amount of tables in this database and I can access them by SAS only,
so my question is: how to obtain this result for every data set in the library?