When one group or more spans more than a page in PDF output produced by PROC REPORT and ODS PDF, what commands would be necessary to make the the group value re-display on the next page.
For example, lets look at STEP 5 in the PDF on SAS website: http://www2.sas.com/proceedings/forum2008/079-2008.pdf.
Supposedly those first two lines are at the bottom of page 1 of the PDF:
County Zip Monthly
Name Code Variety Sales
-------------------------------------
...
Adams 52199 Merlot 233.03
Chardonnay 185.22
Zinfandel 95.84
52200 Merlot 385.51
Chardonnay 246.00
By default, page 2 would look like this:
County Zip Monthly
Name Code Variety Sales
-------------------------------------
76.24
Zinfandel 151.10
Scott 52388 Merlot 122.89
Chardonnay 78.22
Zinfandel 15.40
52423 Merlot 186.00
55.30
Chardonnay 156.61
Zinfandel 35.50
But what if I want every page to redisplay whatever group values from previous page if it spans more than one and even wedge an empty line between each county/zip/variety combo like this below?
Page 1:
County Zip Monthly
Name Code Variety Sales
-------------------------------------
...
Adams 52199 Merlot 233.03
Chardonnay 185.22
Zinfandel 95.84
52200 Merlot 385.51
Chardonnay 246.00
Page 2:
County Zip Monthly
Name Code Variety Sales
-------------------------------------
Adams 52200 Chardonnay 76.24
Zinfandel 151.10
Scott 52388 Merlot 122.89
Chardonnay 78.22
Zinfandel 15.40
52423 Merlot 186.00
55.30
Chardonnay 156.61
Zinfandel 35.50
You can use the SPANROWS option to repeat the group value across pages.
options nodate; ODS PDF FILE='/folders/myfolders/PROC REPORT/spanrows_example.pdf'; proc report data=sashelp.cars spanrows; col make model type origin; define make / group; run; ODS PDF CLOSE;
See pages 3 and 4 of Beyond the Basics: Advanced REPORT Procedure Tips and Tricks Updated for SAS® 9.2 for more details.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.