Hi there,
I have a data set as the picture shows below. For variable R, it has a lot of missing values. What I want to do is to assign the existing value to all the previous blanks. For example, assign 1.0219 to observation 1-10 of R, and assign 0.9598 to observations 12 to 20. Finally the variable R will have 0 missing values. Any ideas?
TIA!
A
OK.
data have ; input a b; cards; 1 . 2 . 3 4 4 5 5 . 6 . 7 . 8 9 ; run; data want; do until(not missing(b)); set have; end; c=b; do until(not missing(b)); set have; output; end; run;
Ksharp
OK.
data have ; input a b; cards; 1 . 2 . 3 4 4 5 5 . 6 . 7 . 8 9 ; run; data want; do until(not missing(b)); set have; end; c=b; do until(not missing(b)); set have; output; end; run;
Ksharp
Thank you so much, Ksharp, you solved my problem!
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.