I have a SAS table with a column data. The data column will contain values like this: XXXX 1123 YYY , SSSSA 1 WWW 3 QQQ, EEE WWS 122, 123 XASS WYSS I want to remove the numeric terms in the middle. So the desired output looks like this: XXXX YYY , SSSSA WWW QQQ, EEE WWS, 123 XASS WYSS I started with this code (to remove the numbers irrespective of the position) but it doesnt give me the answer I need. data want;
set have;
array word[100] $20 _temporary_;
length result $200;
result=' ';
do i=1 to countw(data, ' ');
word[i]=scan(data,i,' ');
if notdigit(word[i]) then do;
result=catx(' ' , result, word[i]);
end;
end;
run;
Can anyone help me to fix the issue and get the desired results?
... View more