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;
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));
This article was originally published by Art Carpenter on sasCommunity.org.
The concept of spanned headers is very interesting and important in Proc Report! 👍
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.