SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

Creating Enhanced List and Summary Reports
Defining Column Headings


Defining the Split Character

To control how words break in column headings, you can use a split character in the column label. When PROC REPORT encounters the split character in a column heading, it breaks the heading and continues the heading on the next line. The split character itself does not appear in the heading.

To use a split character, you can do either of the following:

  • Use the default slash (/) as the split character.
  • Define a split character by using the SPLIT= option in the PROC REPORT statement.


Example

Suppose you want to break headings so that only one word appears on a line. Using the default slash as the split character, you can submit this PROC REPORT step. Notice that the column width has been reduced.


proc report data=flights.europe nowd; where dest in ('LON','PAR'); column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=6 'Flight/Number'; define orig / width=6 spacing=5 'Flight/Origin'; define dest / width=11 spacing=5 'Flight/Destination'; run;

Or you can submit this program, which uses the SPLIT= option and produces exactly the same output:


proc report data=flights.europe nowd split='*'; where dest in ('LON','PAR'); column flight orig dest mail freight revenue; define revenue / format=dollar15.2; define flight / width=13 'Flight*Number'; define orig / width=6 spacing=5 'Flight*Origin'; define dest / width=11 spacing=5 'Flight*Destination'; run;

Here are both types of output from both programs:



Partial PROC REPORT Output, HTML
Flight
Number
Flight
Origin
Flight
Destination
Mail Freight Revenue
821 LGA LON 403 209 $150,634.00
271 LGA PAR 492 308 $156,804.00
271 LGA PAR 366 498 $190,098.00
821 LGA LON 345 243 $150,634.00
821 LGA LON 248 307 $193,930.00

Partial PROC REPORT Output, SAS Listing
 Flight
 Number
     Flight
     Origin
     Flight
     Destination
Mail Freight Revenue 
 821      LGA      LON         403         209   $150,634.00 
 271      LGA      PAR         492         308   $156,804.00 
 271      LGA      PAR         366         498   $190,098.00 
 821      LGA      LON         345         243   $150,634.00 
 821      LGA      LON         248         307   $193,930.00 


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement