Help using Base SAS procedures

Basic description of many variables in one Proc command.

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Basic description of many variables in one Proc command.

Hi All,

 

I have 30+ variables called client1, client2, client3, etc. I would like to see a basic description of these variables (no of obs, mean, min, max, etc.) but using only one PROC command, so I don't have to type it up 30+ times. 

 

How would I do this efficiently?

 

Thanks, 

 

K.


Accepted Solutions
Solution
‎05-23-2017 07:59 AM
Super User
Super User
Posts: 7,565

Re: Basic description of many variables in one Proc command.

Just to add @KurtBremser, as they have not provided the dataset (as always), we are guessing that there is only those variables in there.  It may be simpler if there are other numeric variables to take:

proc means data=sashelp.class;
  var client:;
run;

 Alkthough of course if there are other variables with client prefix then that is also a problem

View solution in original post


All Replies
PROC Star
Posts: 633

Re: Basic description of many variables in one Proc command.

Like this?

 

ods select variables;
proc contents data = sashelp.cars;
run;
Super User
Posts: 7,094

Re: Basic description of many variables in one Proc command.

proc means:

proc means data=sashelp.class;
var _numeric_;
run;

If you need more statistics, add them in the proc means statement.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎05-23-2017 07:59 AM
Super User
Super User
Posts: 7,565

Re: Basic description of many variables in one Proc command.

Just to add @KurtBremser, as they have not provided the dataset (as always), we are guessing that there is only those variables in there.  It may be simpler if there are other numeric variables to take:

proc means data=sashelp.class;
  var client:;
run;

 Alkthough of course if there are other variables with client prefix then that is also a problem

Contributor
Posts: 53

Re: Basic description of many variables in one Proc command.

Thanks for your help. I have other variables as well, but only those with the prefix client. 

 

K. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 125 views
  • 0 likes
  • 4 in conversation