Help***SAS - Fill missing value with the last non missing value variable

#1
Hi,
I wanted to fill missing value with the last non missing value variable.
+----------+--------+-------+
| Variable | Level | Value |
+----------+--------+-------+
| | men | 10 |
|sexe | female | 20 |
| | 0-20 | 5 |
| | 20-40 | 5 |
| | 40-60 | 10 |
| age | >60 | 10 |
+----------+--------+-------+
And I would like to fulfill the "blank" cells using the last non-blank cell to obtain something like this.

+----------+--------+-------+
| Variable | Level | Value |
+----------+--------+-------+
| sexe | men | 10 |
| sexe | female | 20 |
| age | 0-20 | 5 |
| age | 20-40 | 5 |
| age | 40-60 | 10 |
| age | >60 | 10 |
+----------+--------+-------+
 

fed1

TS Contributor
#2
normally the solution is to use a retain statement on the variable to be filled down.


you have sort of logical problem here though. how do you know "0-20" is an age? that is, when you say "fill in the last non missing value" you have to have an ordering, in order to determine what it means to be last.