06-13-2016 10:07 AM
I am trying to identify differents rows in table having a particular word e.g 'DUODENUM' or its variation such as 'DUODENAL' or 'DUODENOM'. I am trying to use spedis function.
Using spedis function, I got an output which reflects that it calculates the value based on different words present before the word 'DUODENUM' and if the row contains only 'DUODENUM' then it gives the value as '0'.
Can anybody suggest me an alternative function or method to identify all records have specific word 'DUODENUM' or with erroneous spelling 'DUODENOM' or 'DUODENAL'.
data test1; set test; value=spedis(report, 'DUODENUM'); run;
Thank you in adavnce for your kind reply.
06-13-2016 02:15 PM
This code will set 3 flag variables with a value of 1 if any of the spellings listed appears. The value will be 0 otherwise.
This is a hardcoded solution and not generic to find other misspellings such as DUODENAM.
Proc freq or any procedure that does counts or sums can get the numbers of the records, where clauses with the flag variables can select the records of interest.
if you don't have a lot of these then you could be okay. If you were looking for a generic solution to multiple spelling issues then please say so.
Another option to consider might be TRANWRD and just correct them.
Report = tranwrd(report,'DUODENOM','DUODENUM');
Report = tranwrd(report,'DUODENAL','DUODENUM');
06-13-2016 04:21 PM
Thank you for your kind reply. I am looking for a generic search method to identify records having 'DUODENUM' or related words with 1-2 character typo. Once the records are flagged, I will get an idea about the different possible spellings and can convert them to correct spellling using transwrd function as advised by you.
Thank you in advance for your kind guidance.
06-16-2016 08:22 AM
Can you guide me further to have sometghing generic in spite of hard code as I want to apply on a dataset having 100000 records.
Thank you in advance for your kind reply.