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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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: