As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Spanning Headers in PROC REPORT"

From sasCommunity
Jump to: navigation, search
m (add wikilink to statement)
(migrated)
 
Line 1: Line 1:
 +
{{Template:Article_Migrated|https://communities.sas.com/t5/SAS-Communities-Library/Spanning-Headers-in-PROC-REPORT/ta-p/476002}}
 
The text of a spanning header is used to form a label for multiple columns.  The text for the spanning header is defined in the COLUMN [[statement]] by adding a quoted string that precedes the columns that are to have the header.  Parentheses can be used to form groups of columns.
 
The text of a spanning header is used to form a label for multiple columns.  The text for the spanning header is defined in the COLUMN [[statement]] by adding a quoted string that precedes the columns that are to have the header.  Parentheses can be used to form groups of columns.
  

Latest revision as of 15:37, 27 July 2018


As part of the decommissioning effort for sasCommunity.org this article/tip has been migrated to communities.sas.com.

The new home for this article/tip is Spanning Headers in PROC REPORT (https://communities.sas.com/t5/SAS-Communities-Library/Spanning-Headers-in-PROC-REPORT/ta-p/476002)



The text of a spanning header is used to form a label for multiple columns. The text for the spanning header is defined in the COLUMN statement by adding a quoted string that precedes the columns that are to have the header. Parentheses can be used to form groups of columns.

In the following example the text 'Size Measurements' forms a header that spans the means for both HEIGHT and WEIGHT.

proc report data=sashelp.class nowd;
 column sex ('Size Measurements' (height weight)),mean;
 define sex / group;
 define mean /  format=6.1;
 run;

Spanning.gif


You can also have nested spanning headers by nesting the parentheses:

  proc report data=sashelp.class nowd;
     columns ('Student Info' (name 
             ('Demographics' sex age))
             ('Measures' height weight));


NestedSpanning.gif


Spanning headers can also be stacked, see Stacking Headers in PROC REPORT.