Hi
I want to fill the data.
The same IDs have the same value.
For example, See under table.
I want to fill 12th row in Dose Group '10 mg' using do loop
becaues, 11th row and 12th row are same Subject Number.
Likewise, 13th row and 14th row, 15th row and 16th row has same value.
How can I do that? Please help me.
You can do something like this
data MyData;
input Subject $ DoseGroup $;
datalines;
2001 10mg
2001 .
2002 10mg
2002 .
2003 10mg
2003 .
;
data Want;
update MyData(obs=0) MyData;
by Subject;
output;
run;
proc print data=Want noobs;
run;
Can we assume that a missing value for the dose group is ALWAYS preceded by a non-missing value? Or could it be that the first value for a subject is already missing?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.