The SAS Output Delivery System and reporting techniques

Proc Print Question

Reply
Regular Contributor
Posts: 173

Proc Print Question

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
SAS Super FREQ
Posts: 8,868

Re: Proc Print Question

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
Regular Contributor
Posts: 173

Re: Proc Print Question

Posted in reply to Cynthia_sas
Thank you so much Cynthia !!!
Ask a Question
Discussion stats
  • 2 replies
  • 113 views
  • 0 likes
  • 2 in conversation