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
SAS Super FREQ
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-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!

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.

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