SAS_learner
SAS_learner

Reputation: 521

How to create SAS code the loops on dataset on given library and list the tables and how many obs in each dataset?

I'm trying to create a macro with library name as input and which loops on all the datasets in that library and lists out the dataset name and number of obs in each dataset... Is there any way to get this by querying dictionary?

Upvotes: 2

Views: 339

Answers (1)

Joe
Joe

Reputation: 63434

Number of obs isn't guaranteed to be accurate, but will usually be if you haven't been mucking around with SQL deletes or other things that might not update the metadata.

proc sql;
create table mycols as select * from dictionary.tables where libname="LIBRARYNAME";
quit;

You probably want NOBS, MEMNAME.

Upvotes: 1

Related Questions