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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2263 views
  • 0 likes
  • 3 in conversation