i could get the results using different methods but i wanted to understand how loop works with set and at the end i got stuck. ok,a not 999 so sas writes the observation same for b and c.Then d=999 so it gets set to missing and sas writes that observation too then when the loops checks for e,last element not 999 nothing changes and sas writes the 5th observation but with the missing value for d again.So it looked like the loop checked 10 20 30 . 50 for the value of d and not 10 20 30 999 50. Probably i am missing something huge about do loops and the output statement. 1 10 20 30 999 50 2 10 20 30 999 50 3 10 20 30 999 50 4 10 20 30 . 50 5 10 20 30 . 50 6 50 40 999 20 10 7 50 40 999 20 10 8 50 40 . 20 10 9 50 40 . 20 10 10 50 40 . 20 10 11 . 1 1 1 999 12 . 1 1 1 999 13 . 1 1 1 999 14 . 1 1 1 999 15 . 1 1 1 .
... View more