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;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.