Hi
I have a vital signs raw data. I have a date column and vital signs test column. there are 5 tests per subject. There is only one date is given for one test. I need to fill the same date for all the tests per subject. Need help with this logic.
the data looks like this:
date test
11/07/2017
. Height
. DBP
. SBP
PULSE
TEMP
Thanks.
Rashmi.
*Try using Retain to keep the variable across the rows and assigning it when new;
data want;
set have;
retain new_date;
if not missing(date) then new_date = date;
run;
@rashmirao99 wrote:
Hi
I have a vital signs raw data. I have a date column and vital signs test column. there are 5 tests per subject. There is only one date is given for one test. I need to fill the same date for all the tests per subject. Need help with this logic.
the data looks like this:
date test
11/07/2017
. Height
. DBP
. SBP
PULSE
TEMP
Thanks.
Rashmi.
where is the subject column?
data want;
set have;
by subject;
retain _date;
if first.subject then call missing(_date);
if not missing(date) then _date=date;
else date=_date;
run;
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.