SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

Creating Enhanced List and Summary Reports
Defining Column Headings


In addition to specifying column widths and spacing, you might want to change column headings. To define a column heading, specify the heading text in quotation marks in the DEFINE statement.


Example

Suppose you want to label Flight as Flight Number, Orig as Flight Origin and Dest as Flight Destination. Add these column headings to the DEFINE statements, being sure to match quotation marks. You can also change the WIDTH= specifications to accommodate the new headings.


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=13 'Flight Number'; define orig / width=13 spacing=5 'Flight Origin'; define dest / width=18 spacing=5 'Flight Destination'; run;
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 


This is HTML output from the same program:



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

 

Now you have the column headings that you want. But the columns are quite wide, aren't they? Let's see what you can do to fix this.


back||next


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

Terms of Use & Legal Information | Privacy Statement