🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 07-15-2016 02:05 PM
(1912 views)
I want to update var1 with the next available var2,3 or 4 value?
Have:
Var1 var2 var3 var4
1 . 1 1
. . . 2
2 1 1 .
. 1 . .
Want :
Var1 var2 var3 var4
1 . 1 1
2 . . 2
2 2 2 .
1 1 . .
Thanks
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please try this.
data want;
set have;
Var1=coalesce(var1,var2,var3,var4);
run;
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please try this.
data want;
set have;
Var1=coalesce(var1,var2,var3,var4);
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you - it worked !!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It looks that the solution provided to you gets Var3 in the 4-th observation to 2. I guess I am doing something wrong.