Help using Base SAS procedures

Help with SUMMARIZE in PROC REPORT

Accepted Solution Solved
Reply
N/A
Posts: 1
Accepted Solution

Help with SUMMARIZE in PROC REPORT

I am new to PROC REPORT and have the following code in SAS. I want BREAK AFTER Manager/SUMMARIZE to give me only the summary of the Successful_test and Failed_test column however I am also getting a summary value for the Created_Date and Closed_Date column (which is a sum of all the dates by group). I only want to display these dates columns without actual showing a summary value. Can that be done?

PROC REPORT data=FLD_AUTH.FAILED_AUTH_REPORT nowd;

COLUMNS Manager Sales_Team FullName Test Stage Created_Date Closed_Date ('-Test Status-' Successful_test Failed_test);

DEFINE Manager/GROUP;

DEFINE Sales_Team/ "Team";

DEFINE FullName/GROUP "Full Name";

DEFINE Created_Date/ "Activity Created Date" format=date9.;

DEFINE Closed_Date/ "Closed Date" format=date9.;

DEFINE Successful_Test/ANALYSIS SUM "Successful Test";

DEFINE Failed_Test/ANALYSIS SUM "Failed Test";

BREAK AFTER Manager/OL SUMMARIZE SUPPRESS;

RBREAK AFTER/OL SUMMARIZE;

RUN;


Accepted Solutions
Solution
‎01-21-2015 06:17 PM
SAS Super FREQ
Posts: 8,864

Re: Help with SUMMARIZE in PROC REPORT

Posted in reply to yanman3000

Hi:

  Since SAS dates are numeric variables, the default usage for them is ANALYSIS SUM, even if you do not code it. So you will need to explicitly put DISPLAY as the usage for your date variables. Then they will not be summarized at the break. If you receive notes in the log about how grouping cannot be done, then you may want to change the usage of Manager and FullName to ORDER, as well. Since you did not provide data or other information, it is hard to actually run your code.

  BTW, options like OK are LISTING destination only options. So if you are creating a report for ODS (like ODS HTML, ODS RTF or ODS PDF), then the OL option will be ignored.

cynthia

View solution in original post


All Replies
Solution
‎01-21-2015 06:17 PM
SAS Super FREQ
Posts: 8,864

Re: Help with SUMMARIZE in PROC REPORT

Posted in reply to yanman3000

Hi:

  Since SAS dates are numeric variables, the default usage for them is ANALYSIS SUM, even if you do not code it. So you will need to explicitly put DISPLAY as the usage for your date variables. Then they will not be summarized at the break. If you receive notes in the log about how grouping cannot be done, then you may want to change the usage of Manager and FullName to ORDER, as well. Since you did not provide data or other information, it is hard to actually run your code.

  BTW, options like OK are LISTING destination only options. So if you are creating a report for ODS (like ODS HTML, ODS RTF or ODS PDF), then the OL option will be ignored.

cynthia

Super User
Posts: 10,023

Re: Help with SUMMARIZE in PROC REPORT

Posted in reply to yanman3000

Using compute block. I suppress the print of sum of age.

options missing=' ';
proc report data=sashelp.class nowd;
columns sex name age weight;
define sex/group;
define name/display;
define age/analysis sum;
define weight/analysis sum;
compute after sex;
 age.sum=.;
endcomp;
compute after;
 age.sum=.;
endcomp;
BREAK AFTER sex/summarize;
RBREAK AFTER/summarize;
RUN;

Xia Keshan

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 742 views
  • 3 likes
  • 3 in conversation