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

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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