04-16-2013 01:55 PM
Hi everyone -
I am trying to add multiple text strings onto a single record.
From something like this:
ID TEXT_1 TEXT_2
001 aaaaa bbbbb
002 ccccc ddddd
Here is what I'd like to achieve:
Any help would be greatly appreciated. Thanks,
04-16-2013 02:00 PM
Can it be like this?
text_3 = compress(text_1,text_2);
or do you want it like this?
proc transpose data = in out = want;
var text_1 text_2;
set want(rename = (col1 = text_3 ) drop = _NAME_);
04-16-2013 02:11 PM
Thanks, Anca. Is there a way to get rid of the multiple IDs. I used array to get to the same result as you did with the transpose though.
04-16-2013 02:39 PM
Let me suggest that getting rid of the multiple IDs is a bad idea. You don't have to print them, even with PROC PRINT you can try:
And you have even more choices if you learn PROC REPORT. But if you get rid of the multiple IDs you will have to jump through hoops if you ever want to sort your data.
Need further help from the community? Please ask a new question.