BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
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

3 REPLIES 3
Kalind_Patel
Lapis Lazuli | Level 10

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.

hashman
Ammonite | Level 13

@BrahmanandaRao:

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. 

PaigeMiller
Diamond | Level 26

How would a programmer in your situation know what are incorrect spellings that need to be corrected? 

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1858 views
  • 1 like
  • 4 in conversation