Help using Base SAS procedures

Contents of Oracle Library/Tables ...No. of Obs in a Oracle Table

Reply
Contributor
Posts: 63

Contents of Oracle Library/Tables ...No. of Obs in a Oracle Table

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 ;
Regular Contributor
Posts: 171

Re: Contents of Oracle Library/Tables ...No. of Obs in a Oracle Table

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.
Super User
Posts: 9,676

Re: Contents of Oracle Library/Tables ...No. of Obs in a Oracle Table

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
Ask a Question
Discussion stats
  • 2 replies
  • 154 views
  • 0 likes
  • 3 in conversation