BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Angel_Saenz
Quartz | Level 8

I need a list of all datasets in a library but showing number of observations of each one

Like:

proc datasets library=libname;

run;

But showing the number of observations of all datasets.

Do you know if exists a proc for that?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20


data list;
set sashelp.vtable;
where libname='WORK';
keep memname nobs;
run;

proc print noobs;run;

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Use PROC CONTENTS

 

proc contents data=_all_ details;
run;
--
Paige Miller
novinosrin
Tourmaline | Level 20


data list;
set sashelp.vtable;
where libname='WORK';
keep memname nobs;
run;

proc print noobs;run;
Jagadishkatam
Amethyst | Level 16

alternatively with proc sql,

 

dictionary tables

 

proc sql;
create table want as select memname, nobs from dictionary.tables where libname='SASHELP';
quit;
Thanks,
Jag

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 4512 views
  • 1 like
  • 4 in conversation