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

Hi,

 

I'm trying to analyze data by looking at changes in blood pressure (BP) over three measurements. I would like to add a column to each row that shows the difference between the highest and lowest of the three measurements.

For example: BP1- 120, BP2 - 160, BP3 - 140 -----> Range = (160 - 120) = 40

 

I am new to SAS and am at a loss of how to approach this. I have looked everywhere for a solution.

 

Any help would be great.

 

Thanks.

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
SASKiwi
PROC Star
range = range(of BPZSY1 - BPZSY3);

 

You will find it useful to bookmark documentation.sas.com:

https://documentation.sas.com/?docsetId=lefunctionsref&docsetTarget=n11w5ix15y2l4fn1l8arb0ntlpra.htm...

pubhealthguy
Calcite | Level 5

This is just what I was looking for.

Thank you for your help!

SASKiwi
PROC Star

@pubhealthguy - glad this answer helped. Please update this post as answered.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 766 views
  • 5 likes
  • 2 in conversation