BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am creating a report that has page breaks by “Year”, and summing several amounts. When I use both the BY and SUM statements, the report has the correct page breaks and the column sums are fine, but I would like to remove (suppress) the BY variable that always appears under the first column (underlined) in my output report. I have included some example code below that will produce the report in the format I want, but would like to suppress the text "YEAR" that appears underlined under column for "Var1".


data File1;
input
@001 Var1 $ 1.
@002 Var2 $ 8.
@011 Var3 $ 3.
@015 Year $ 4.
@020 Amt1 D5.2
@026 Amt2 D5.2
;
datalines;
234567856 A13 1997 12465 58493
417485930 N13 2005 73464 48976
428748594 L01 1998 56456 00456
222211111 L01 2005 45578 03405
254323454 P14 2005 00345 39403
200203945 Q11 1997 64532 44444
200456432 J45 1998 13456 09887
413456654 P12 2005 54565 23456
;
run;
proc sort data=File1;
by year;
run;
proc print Data=File1 UNIFORM noobs label;
OPTIONS CENTER NODATE PAGENO=1 nobyline ;
title1 'Page Break Report Example';
Title2 'Year = #BYVAL(year)';
format amt1 dollar10.2
amt2 dollar10.2
;
by year;
sum amt1 amt2;
run;
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The new PROC PRINT option SUMLABEL with SAS 9.2 allows more control over the label of the SUM total row. Otherwise, you may have to consider PROC REPORT as an alternative approach, possibly.

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1124 views
  • 0 likes
  • 3 in conversation