BookmarkSubscribeRSS Feed

Spanning Headers in PROC REPORT

Started ‎07-06-2018 by
Modified ‎07-06-2018 by
Views 26,477

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

 

This article was originally published by Art Carpenter on sasCommunity.org.

Comments

The concept of spanned headers is very interesting and important in Proc Report! 👍

Contributors
Version history
Last update:
‎07-06-2018 03:31 PM
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Labels
Article Tags