Help using Base SAS procedures

Basic description of many variables in one Proc command.

Accepted Solution Solved
Reply
Contributor
Posts: 38
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
Esteemed Advisor
Esteemed Advisor
Posts: 6,989

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
Super Contributor
Posts: 482

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

Like this?

 

ods select variables;
proc contents data = sashelp.cars;
run;
Esteemed Advisor
Posts: 6,288

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
Esteemed Advisor
Esteemed Advisor
Posts: 6,989

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: 38

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
  • 76 views
  • 0 likes
  • 4 in conversation