BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

proc report data=sashelp.class nowd;
columns name sex age height weight ;
define age/display ANALYSIS;
define height/display;
rbreak after/ summarize;
run;

 

WHAT IS THE USE OF ANALYSIS IN ABOVE DATA PROGRAM

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

See my answer to your related thread here.

Cynthia_sas
SAS Super FREQ

Hi:
As @PeterClemmensen recommending, reading the PROC REPORT documentation will help you here. You only need 1 usage usually, with a variable in a PROC REPORT DEFINE statement. So if you want age to be summarized on the RBREAK, then you need the usage of ANALYSIS (and you will get the default analysis statistic of SUM). However, if you want AGE not to be included in any grand total summary line, then a usage of DISPLAY is appropriate.

Now, getting a summary of all the ages or all the heights doesn't make sense, and in your code, if you run it, you'll see that AGE and WEIGHT are summarized at the RBREAK, but HEIGHT (because it is a usage of DISPLAY) is NOT summarized.

Asking for the MEAN or MIN or MAX on the summary line would be more likely on a report that showed every detail row. You can achieve this by changing the statistic on the DEFINE statement. Oh, wait, you don't have a statistics, so you are getting the DEFAULT of SUM for AGE and WEIGHT.

See what happens if you do this:

proc report data=sashelp.class nowd;
columns name sex age height weight ;
define age/min ANALYSIS;
define height/display;
define weight / analysis min;
rbreak after/ summarize;
run;



Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 851 views
  • 0 likes
  • 3 in conversation