Proc Report (Not getting Min and Mean of same variable)

Solved
Occasional Contributor
Posts: 8

Proc Report (Not getting Min and Mean of same variable)

Hi,

Proc Report Data=Cars;
Column MSRP Length;
Define MSRP/Max;
Define Length/Min;
Define Length/Mean;
Run;

I got only the Mean of Length variable . I didn't get the Minimum of Length variable. Anyone help me what is the problem of this code?

Thank you

Accepted Solutions
Solution
‎08-02-2017 04:12 AM
PROC Star
Posts: 8,150

Re: Proc Report (Not getting Min and Mean of same variable)

Posted in reply to Divya_Joseph

You need to create aliases. A nice example can be found at: http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n0ldy84v9j7463n1jjklo...

Art, CEO, AnalystFinder.com

All Replies
Solution
‎08-02-2017 04:12 AM
PROC Star
Posts: 8,150

Re: Proc Report (Not getting Min and Mean of same variable)

Posted in reply to Divya_Joseph

You need to create aliases. A nice example can be found at: http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n0ldy84v9j7463n1jjklo...

Art, CEO, AnalystFinder.com

Occasional Contributor
Posts: 11

Re: Proc Report (Not getting Min and Mean of same variable)

Posted in reply to Divya_Joseph

Since, you want to perform analysis on same column and represent it in 2 separate columns of your report as min and mean, you will have to create aliases.

Your code should be something like ...

``````Proc Report Data=Cars;
Column MSRP Length=Length_min Length=Length_mean;
Define MSRP/Max;
Define Length_min/Min;
Define Length_mean/Mean;
Run;``````

I have assumed that MSRP and Length variables are numeric in your dataset.

More information can be found on the SAS documentation:

http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n0ldy84v9j7463n1jjklo...

Occasional Contributor
Posts: 8

Re: Proc Report (Not getting Min and Mean of same variable)

Posted in reply to Divya_Joseph

Thank you for sending me the answer. I tried  and it worked for me.

☑ This topic is solved.

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

Discussion stats
• 3 replies
• 160 views
• 0 likes
• 3 in conversation