Hi all,
I have a column named ID filled out like this (with blancs):
data have; input ID $; infile datalines missover; datalines; 1 2 3 4 5 ;
I would like to fill out all blancs with the last value populated, so the column I want would look like this:
data want; input ID $; infile datalines missover; datalines; 1 2 3 3 3 4 5 5 ;
Thank you for your help. Kind regards
Hi @Aljosa
Here is one approach to achieve this:
data want;
set have;
retain _ID;
if not missing(ID) then _ID = ID;
drop ID;
rename _ID = ID;
run;
Best,
Hi @Aljosa
Here is one approach to achieve this:
data want;
set have;
retain _ID;
if not missing(ID) then _ID = ID;
drop ID;
rename _ID = ID;
run;
Best,
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!
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.