Hi everyone, I have a sample dataset as follows: id weight1 weight2 weight3 weight4 1 50.1 51.8 . 53.6 2 70.8 . . . 3 . 49.8 52.9 . 4 . 68.1 . 66.9 5 48.0 49.1 . . I have tried the command as below, data locf; set tweight; array weight weight:; do i=1 to dim(weight); if weight=. then weight=weight[i-1]; end; drop i; run; Then the output is as follows: id weight1 weight2 weight3 weight4 1 50.1 51.8 51.8 53.6 2 70.8 70.8 70.8 70.8 BUT that is not what I expected because there are all missing after id 2. :smileyconfused::smileyconfused: I am trying to amend the command......and produce the output as below, id weight1 weight2 weight3 weight4 1 50.1 51.8 51.8 53.6 2 70.8 70.8 70.8 70.8 3 . 49.8 52.9 52.9 4 . 68.1 68.1 66.9 5 48.0 49.1 49.1 49.1 I think I missed ONE "if XXXXXX" or "else XXXXXX"~Please help~:smileyplus:
... View more