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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.