10-28-2013 09:18 AM
I have some 50 tables and i need table count of each. Apart from running select count (*) from table name.
Do we have any other method that will give in single shot 50 or 100 tables count and table name with proper layout.
Can anyone suggest on this plz.
|Header 1||Header 2|
10-28-2013 09:41 AM
This is something you could do quite easily by reading the DICTIONARY.TABLES dataset. There are a lot of previous posts about finding out information about your table and columns using this technique. In addition, there are Tech Support notes like this:
http://support.sas.com/kb/25/436.html, and documentation topics like this one:
The variables in DICTIONARY.TABLES include a variable called NOBS and another called CRDATE -- which are the count of physical observations and the creation date, respectively.
10-28-2013 01:00 PM
Thank you for your information. But i am little worried to use dictionary. Because there seems to be every time i need to select respective table name in find for your contents. Actually i dont want contents at all. I only require table name and respective count of that table like 500 observations. if number of tables are 50 or >50 at single shot how i can get the output which shows 50 table names with respective counts in proper lay out.
10-28-2013 01:10 PM
Open up sashelp.vtable and take a look at the columns and run the following and see what it outputs.
Proc print data=sashelp.vtable (obs=20);
var libname memname nobs nlobs nvar;
10-28-2013 01:28 PM
Its nice. But i have created a new library and i only want count from that particular library and not from any other (rawdata,gismaps ets) with out mentioning obs. Can you plz suggest me
10-28-2013 01:40 PM
I am not sure what your issue is. Just run the query and use the data in whatever way you want.
Use a WHERE clause the select the tables you are interested in.
libname mylib 'mypath';
proc sql ;