Hello - I seached for documentation on how to properly create the sum of a variable using the RBREAK function. I can't seem to find the right syntax. All I want to do is show a summation for the column titled "CurrBal". Can someone show/point me to documentation that shows how to properly do so.
Thanks for the guidiance.
/*CODE BELOW*/
proc report
data = CML.Final_&ReportDate. nowd missing;
where Product_Name like '%HYBRID%';
Column
OpenDateDT Acct CustomerName CurrBal Product_Name
Org_Level_02 Org_Level_03 Org_Level_04 Org_Level_05 Org_Level_06;
label
OpenDateDT = 'Open Date';
DEFINE Acct / STYLE(COLUMN)=[CELLWIDTH=115PX TEXTALIGN=r tagattr="format:@"];
DEFINE OpenDateDT / STYLE(COLUMN)=[CELLWIDTH=125PX TEXTALIGN=l tagattr='type:DateTime format:mm/dd/yyyy'];
DEFINE Product_Name / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE CustomerName / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_02 / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE Org_Level_03 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_04 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_05 / STYLE(COLUMN)=[CELLWIDTH=500PX TEXTALIGN=l];
DEFINE Org_Level_06 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
run;
Balance |
$50,000,000.00 |
$32,515,368.16 |
$18,003,846.79 |
$15,007,005.27 |
$14,742,712.88 |
$10,000,890.41 |
$5,002,123.52 |
$2,459,806.99 |
$1,502,804.41 |
$1,005,426.95 |
$1,000,816.70 |
$603,445.59 |
$0.00 |
$151,844,247.67 (missing summation value that I want the report to calculate) |
Have you tried:
Rbreak after / ol summarize;
Thanks for the suggestion, To answer your question, yes I have. The problem is that the summarized line is also providing a summary line for Date and Interest Rate, my guess is because they are also numeric variables. I only want to show a summarized line for CurrBal. How do I use this function but not have it included summary lines for Date and Interest Rate? Also the summary line isn't well defined when it's used it as part of an Excel ODS. Is there a way to make the total calucation bold?
Thanks!
proc report
data = CML.Final_&ReportDate. nowd missing;
where Product_Name like '%NOTICE%';
Column
OpenDateDT Acct CustomerName CurrBal InterestRate Product_Name
Org_Level_02 Org_Level_03 Org_Level_04 Org_Level_05 Org_Level_06;
label
OpenDateDT = 'Open Date';
DEFINE Acct / STYLE(COLUMN)=[CELLWIDTH=115PX TEXTALIGN=r tagattr="format:@"];
DEFINE OpenDateDT / STYLE(COLUMN)=[CELLWIDTH=125PX TEXTALIGN=l tagattr='type:DateTime format:mm/dd/yyyy'];
DEFINE CurrBal / sum;
DEFINE InterestRate / STYLE(COLUMN)=[CELLWIDTH=125PX TEXTALIGN=r tagattr='format:.0%'];
DEFINE Product_Name / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE CustomerName / STYLE(COLUMN)=[CELLWIDTH=375PX TEXTALIGN=l];
DEFINE Org_Level_02 / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE Org_Level_03 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_04 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_05 / STYLE(COLUMN)=[CELLWIDTH=500PX TEXTALIGN=l];
DEFINE Org_Level_06 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
Rbreak after / summarize dol dul;
title 'NOTICE REPORT';
run;
Thanks for the reply. I'm not quite following your suggestion. The line below is blue is the only summary line that I want to show. The two in red are the ones showing now that I don't want displayed. I haven't been able a way to drop the two summaries that I don't need.
proc report
data = CML.Final_&ReportDate. nowd missing;
where Product_Name like '%NOTICE%';
Column
OpenDateDT Acct CustomerName CurrBal InterestRate Product_Name
Org_Level_02 Org_Level_03 Org_Level_04 Org_Level_05 Org_Level_06;
label
OpenDateDT = 'Open Date';
DEFINE Acct / STYLE(COLUMN)=[CELLWIDTH=115PX TEXTALIGN=r tagattr="format:@"];
DEFINE OpenDateDT / STYLE(COLUMN)=[CELLWIDTH=125PX TEXTALIGN=l tagattr='type:DateTime format:mm/dd/yyyy'];
DEFINE CurrBal / sum;
DEFINE InterestRate / STYLE(COLUMN)=[CELLWIDTH=125PX TEXTALIGN=r tagattr='format:.0%'];
DEFINE Product_Name / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE CustomerName / STYLE(COLUMN)=[CELLWIDTH=375PX TEXTALIGN=l];
DEFINE Org_Level_02 / STYLE(COLUMN)=[CELLWIDTH=250PX TEXTALIGN=l];
DEFINE Org_Level_03 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_04 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
DEFINE Org_Level_05 / STYLE(COLUMN)=[CELLWIDTH=500PX TEXTALIGN=l];
DEFINE Org_Level_06 / STYLE(COLUMN)=[CELLWIDTH=400PX TEXTALIGN=l];
rbreak after / summarize dol dul;
title 'NOTICE REPORT';
run;
Thank you for the insight. I did some addiitonal research and the code is working as expected.
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 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.
Ready to level-up your skills? Choose your own adventure.