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;
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
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
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.