BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6
I am using Proc Print SUM to print the total. Can I use LABEL on the sum?
In the example below, I would like to change "ALLOCNBR" to "Fund Total". How can I do this in proc print?

Thanks for any input!!
KevinC.

PAYMENT
YEAR COUNT TOTAL DUE SPECHNDL

2008 1 $25,000.00 MYP
2009 2 $35,000.00 MYP
2010 2 $45,000.00 MYP
2011 1 $20,000.00 MYP
-------- ---------------
ALLOCNBR $125,000.00
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
Starting in SAS 9.2 you can use the SUMLABEL option to display the BY variable label on the summary line:
http://support.sas.com/documentation/cdl/en/proc/59565/HTML/default/a000064114.htm

However, PROC REPORT has always had the capabililty to do this -- 2 examples are below -- one with BY groups and one without:
[pre]
proc report data=sashelp.shoes nowd;
where region in ('Asia', 'Canada') and
product='Slipper';
column region subsidiary sales;
define region / order;
break after region / summarize;
compute after region;
Region = 'Fund Total';
endcomp;
run;


proc report data=sashelp.shoes nowd;
where region in ('Asia', 'Canada') and
product='Slipper';
by region;
column region subsidiary sales;
define region / order noprint;
break after region / summarize;
compute after region;
Subsidiary = 'Fund Total';
endcomp;
run;

[/pre]

You may have to do some other small changes if ALLOCNBR or YEAR is numeric. But PROC REPORT may get you what you want without waiting for 9.2 to be installed.

cynthia
KevinC_
Fluorite | Level 6
Thank you so much Cynthia !!!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1072 views
  • 0 likes
  • 2 in conversation