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.