New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aloou
Obsidian | Level 7

hello every one,

is it possible to Apply proc summary or proc means or proc univariate on a whole Library, like :

proc summary data=libref._ALL_ ;

var _NUMERIC_;

quit;

 

i have been trying that but it is not working.

 

Thank you for the help

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

In my experience, computing summary statistics on a huge number of variables is of very limited usefulness, and not worth the time to do it. So I don't do this any more.

 

Nevertheless, if you are going to do this, I think it would make more sense to save the output in a SAS data set, in which you could actually search, and later analyze, rather than a huge number of HTML outputs as in the method from @ed_sas_member .

--
Paige Miller

View solution in original post

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Two questions: 

 

Why do you want to do this?

 

How many data sets are we talking?

ed_sas_member
Meteorite | Level 14

Hi @aloou ,

 

Maybe this is something you can try :

%macro stat_lib (lib);

	proc contents data=&lib.._all_ noprint out=work.lib_list;
	run;

	proc sort data=work.lib_list (keep= memname type where=(type=1)) nodupkey;
		by memname;
	run;

	data _null_;
		set lib_list;
		call symput("memname"||left(_n_),memname);
		call symput("nbdatasets",_n_);
	run;

	%do i=1 %to &nbdatasets;
		title "Summary statistics of dataset &lib..&&memname&i";
		proc means data=&lib..&&memname&i;
		var _numeric_;
		run;
		title;
	%end;

%mend;

%stat_lib(<your library>);

(code not tested)

PaigeMiller
Diamond | Level 26

In my experience, computing summary statistics on a huge number of variables is of very limited usefulness, and not worth the time to do it. So I don't do this any more.

 

Nevertheless, if you are going to do this, I think it would make more sense to save the output in a SAS data set, in which you could actually search, and later analyze, rather than a huge number of HTML outputs as in the method from @ed_sas_member .

--
Paige Miller
Reeza
Super User

It's not possible to do this easily in one step and I likely wouldn't recommend it anyways. 

You can automate it quite easily though, will the data sets have anything in common or are they all entirely different?

 


@aloou wrote:

hello every one,

is it possible to Apply proc summary or proc means or proc univariate on a whole Library, like :

proc summary data=libref._ALL_ ;

var _NUMERIC_;

quit;

 

i have been trying that but it is not working.

 

Thank you for the help


 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 4 replies
  • 1204 views
  • 1 like
  • 5 in conversation