BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Divya_Joseph
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
art297
Opal | Level 21

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

 

subobscure
Obsidian | Level 7

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...

 

 

 

Divya_Joseph
Calcite | Level 5

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

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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