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

StackOverflow https://stackoverflow.com/questions/14961105

  •  10-03-2022
  •  | 
  •  

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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top