BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
camdbean
Fluorite | Level 6

Nesting Headers in PROC REPORT

**********************************************************************************

Hello SAS Communities,

I am trying to nest MEAN and STD statistics for two variables: SBP (Systolic Blood Pressure) and DBP (Diastolic Blood Pressure). I am attempting to nest them so that I have one Spanning header reading "Average Pressures", within this are two more headers "Systolic" and "Diastolic", where finally my MEAN and STD calculations are located for each variable. My issue is, when nesting my variables, I am getting all of my desired headers, with the addition of the original variable labels right below my "Systolic" and "Diastolic" headers. Is there any way to suppress the original variable labels?

 

My code is below

 

 

TITLE1 “Blood Pressure Summaries by Race”;
PROC REPORT DATA = WORK.Test;
           COLUMN RaceCd N
                           ("Average Pressures" ("Systolic" SBP,(MEAN STD))
                                                              ("Diastolic" DBP,(MEAN STD))
                            );
            DEFINE RaceCd / GROUP;
            DEFINE SBP / FORMAT = 4.1;
            DEFINE DBP / FORMAT = 4.1;

            RBREAK AFTER / SUMMARIZE;
RUN;
TITLE;

 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
dthompsonada
Obsidian | Level 7

Hi camdbean,

I had a hard time with this as well. I originally attempted this same set up in the column statement. I got some advice (From a TA!) and this worked:

COLUMN RaceCd N
("Average Pressures" SBP DBP),(MEAN STD);

 

And then add label text to your DEFINE statements like this:

 

DEFINE SBP / FORMAT = 5.1 'Systolic';
DEFINE DBP / FORMAT = 5.1 'Diastolic';

Everything else in our code was the same.

 

Hope that helps!

Danielle

View solution in original post

2 REPLIES 2
dthompsonada
Obsidian | Level 7

Hi camdbean,

I had a hard time with this as well. I originally attempted this same set up in the column statement. I got some advice (From a TA!) and this worked:

COLUMN RaceCd N
("Average Pressures" SBP DBP),(MEAN STD);

 

And then add label text to your DEFINE statements like this:

 

DEFINE SBP / FORMAT = 5.1 'Systolic';
DEFINE DBP / FORMAT = 5.1 'Diastolic';

Everything else in our code was the same.

 

Hope that helps!

Danielle

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 699 views
  • 3 likes
  • 3 in conversation