Hi guys, I want to create a table like this by using PROC REPORT:
-Gender- -Gender-
Age Female Male Female Male
Group SBP SBP DBP DBP
<=50 XX XX XX XX
>50 XX XX XX XX
The data set I have looks like this:
Gender Age SBP DBP
M 23 144 90
F 68 110 62
M 55 130 80
F 28 120 70
M 35 142 82
M 45 150 96
F 48 138 88
F 78 132 76
My problem is:
I can create a new variable 'Age Group' with values '<=50' and '>50',
but I couldn't group the created 'Age Group' variable.
Can anyone give me some insights? Thank you.
Show what code you've tried.

Hi data_null,
Thank you for your answer, however when I was dealing with this problem, the dataset had already existed, so I was wondering if there is one way to just use proc report, and within the proc report statement to group age values, and achieved the desired result, without using other statements?
The user defined value format is independent of the data.
Yes, you're right. But is there a way to group age within the proc report statement?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.