SubjectID | Test_Name | Date | Collection_Time | Result_Value | Result_Units |
123456 | Height | 6/8/2010 | NA | 1.53 | m |
123456 | Height | 6/22/2010 | NA | 1.51 | m |
123456 | Height | NA | NA | 1.51 | m |
123456 | Weight | 6/8/2010 | NA | 63 | kg |
123456 | Weight | 6/22/2010 | NA | 62 | kg |
123456 | Weight | NA | NA | 61 | kg |
123456 | Weight | NA | NA | 61 | kg |
456789 | Height | 8/12/2010 | NA | 1.36 | m |
456789 | Height | NA | NA | 1.36 | m |
456789 | Height | 7/30/2010 | NA | 1.36 | m |
456789 | Weight | 8/12/2010 | NA | 36 | kg |
456789 | Weight | NA | NA | 36 | kg |
456789 | Weight | 7/30/2010 | NA | 36 | kg |
Now if height is missing in all visits, then BMI is blank
if height is missing in one of the visits, take height from previous visits(from the last visit ordered by visit date)
if weight is missing in one of the visits, leave BMI blank
BMI is not present in this data set. Please explain further what you want to do and provide lots of details so we can understand your problem.
need to derive BMI. using below formula
BMI = Weight/(Height * Height)
result_value is not BMI. it is actually weight and height values
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!
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.