Hi there, I am trying to identify records having a specific word as part of the record. There may be spelling error with alteration in 1-2 characters. A sample dataset is attached for your kind cosnideration. I am trying to flag records having the word "DUODENUM" as well as "DUODENAL" and "DUODENOL" without hard coding. I am not sure whether spedic function or soundex function will be of help. To begin with, I used spedis function but I realized that it taking into consideration of the whole statement and the word itself. So I don't know how to apply the matching crieria for alteration in 1-2 characters in the word itself. Sas code used: data test1;
set test;
if find(report, 'DUODENUM') then value1=spedis(report, 'DUODENUM');
if value1 ne .;
run;
proc sort data =test1(obs=1) out =test2 ; by value1 ;run;
proc sql;
create table test3 as
select id,report, (select value1 from test2) as value1, spedis(report, 'DUODENUM') as value2
from test
where (calculated value2 - calculated value1) le 2 ;
quit; later I tried the follwoing code as adviced by Ksharp: proc sql;
create table test3 as
select value1, value2
from test as a, test as b
where value1 =* value2 ;
quit; I got following message in the log: ERROR: The following columns were not found in the contributing tables: value1, value2. Being novice in SAS, I am not understanding the logic provided by Ksharp. Hence I did not altered the code to generate value 1 and value 2. Can somebody help me further with this. Thank you in advance for your kind support. Regards, Deepak
... View more