Help using Base SAS procedures

Basic description of many variables in one Proc command.

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 107
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: 9,599

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

Posted in reply to KurtBremser

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: 1,269

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

Like this?

 

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

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
How to convert datasets to data steps
How to post code
Solution
‎05-23-2017 07:59 AM
Super User
Super User
Posts: 9,599

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

Posted in reply to KurtBremser

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

Frequent Contributor
Posts: 107

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