DATA Step, Macro, Functions and more

Creating Multiple outputs from a single PROC MEANS step

Reply
Contributor
Posts: 35

Creating Multiple outputs from a single PROC MEANS step

Hi all,

      Can anyone guide me that, how to create multiple outputs from a single proc means step.

 

for example, I have code like:

 

proc means data = have;

class sex;

var age salary loan;

output out = --------;

run;

 

wrt to above code, I would require three outputs for age, salary, and loan separately.

 

Thanks in advance

Regular Contributor
Posts: 165

Re: Creating Multiple outputs from a single PROC MEANS step

my answer won't be right but it will be quick: try proc summary, or transpose data set, new variable called 'parameter' which assumes values 'age', 'salary' and 'loan' and then:

 

ods output ....;

proc means data=;

var var;

by parameter;

run;

--------------
blog: papersandprograms.com
Highlighted
Super User
Super User
Posts: 8,127

Re: Creating Multiple outputs from a single PROC MEANS step

What do you mean by multiple outputs?

 

If you want to make multiple separate datasets then add multiple OUTPUT statements.

proc summary data=sashelp.class ;
  class sex ;
  var age height ;
  output out=xx mean(age)=age ;
  output out=yy mean(height)=height ;
run;
Contributor
Posts: 35

Re: Creating Multiple outputs from a single PROC MEANS step

Thank you for replay,
multiple outputs in the sense.. multiple datasets of variable specific.
thank you.
Ask a Question
Discussion stats
  • 3 replies
  • 199 views
  • 7 likes
  • 3 in conversation