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
  •  | 
  •  

Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top