BookmarkSubscribeRSS Feed
GPatel
Pyrite | Level 9
Code below gives me table information except for number of physical observations for all the tables in Justice Oracle library.

How can I get list of library name, member name and no. of records in each table?


LIBNAME justice ORACLE
PATH=Total.world
SCHEMA=usa
USER=xxxxx
PASSWORD="xxxxxxx"
READBUFF=1
;

Proc Sql ;
create table test1 as
select libname, memname, nobs
from dictionary.tables
where libname='JUSTICE' ;
quit ;
2 REPLIES 2
polingjw
Quartz | Level 8
If your DBA has given you the appropriate permissions, you can query the Oracle system tables. Use “SYS” as the schema when you assign a library to the system tables:

LIBNAME justSYS ORACLE
PATH=Total.world
SCHEMA=’SYS’
USER=xxxxx
PASSWORD="xxxxxxx";

You should be able to query the justSYS.ALL_TABLES view to obtain the number of observations in a given table. Specifically, look at using the TABLE_NAME and NUM_ROWS variables.
Ksharp
Super User
Another way.
If you want, using proc copy or proc cport to copy these tables from Oracle to local computer,then use your code to query.But It is low efficient.



Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 2956 views
  • 0 likes
  • 3 in conversation