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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.