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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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

Ksharp
Super User

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

What is Bayesian Analysis?

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.

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
  • 2 replies
  • 4315 views
  • 3 likes
  • 3 in conversation