data test;
x='Ameriica';
run;
correct the spelling its is one data if we have huge file in that miss spell words how to solve it
I personally believe that SAS Data Quality tools (DataFlux) should be used in such cases, because it's specially designed for this kind of purpose and already has QKB (Quality Knowledge Base) built-in to correct the typo mistakes like "Ameriica",
About your question, if you don't have SAS Data Quality tools, you've to make your word list for this table and have to pass it through if condition, for an example :
data have;
input x $8.;
infile datalines;
datalines;
Ameriica
Ceneda
;;;;
run;
data want;
set have;
if x in ("Ameriica", "Americca", "Amarica") then x="America";
if x in ("Ceneda", "Caneda" ) then x="Canada";
run;
You can manually identify the wrong spellings from the data by using Proc Freq (by checking unique values of it) or any other reporting procedure and add those wrong spellings in the list like above, but it might take a long if you've so many columns and data to correct it.
Spell checking isn't simple business. Instead of restating what has already been eloquently said elsewhere, I'd suggest that you take a look at this thread:
https://communities.sas.com/t5/SAS-Programming/Speling-Korrecter/td-p/33164
Kind regards
Paul D.
How would a programmer in your situation know what are incorrect spellings that need to be corrected?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.