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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.