btext1 | btext2 | btext3 | trt1 | trt2 | trt3 |
sample1 | XXX | XXX | XXX | ||
sample1 | ana1 | XXX | XXX | XXX | |
sample1 | ana1 | ban1 | XXX | XXX | XXX |
sample1 | ana1 | ban2 | XXX | XXX | XXX |
sample1 | ana1 | ban3 | XXX | XXX | XXX |
sample1 | ana1 | ban4 | XXX | XXX | XXX |
text | trt1 | trt2 | trt3 |
sample1 | XXX | XXX | XXX |
ana1 | XXX | XXX | XXX |
ban1 | XXX | XXX | XXX |
ban2 | XXX | XXX | XXX |
ban3 | XXX | XXX | XXX |
ban4 | XXX | XXX | XXX |
can any one help me in this?
Look up Coalescec() function and Keep/Drop statement.
Haikuo
Per Hai.kuo, this is covered in this post: https://communities.sas.com/message/226275#226275
data want(drop=btext2 btext3);
set have;
if btext2 ne ' ' and btext3=' ' then btext1=btext2;
if btext3 ne ' ' then btext1=btext3;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: