Proc spell

From sasCommunity

Jump to: navigation, search

Proc Spell is a v6 procedure, no longer documented in v9.1 or v9.2.

basic syntax from

http://www.sas.com/offices/NA/canada/downloads/presentations/Calgary/Tips_and_Tricks.pdf

filename textdata 'c:\text.txt';
PROC Spell in = textdata
           verify;
run;

Old But Not Obsolete: Undocumented Procedures, Barbara Okerson, http://analytics.ncsu.edu/sesug/2007/SD06.pdf

filename Spelt '<file-specification>';

PROC Spell in         = Spelt 
           dictionary = Words.spell.mywords 
                        verify 
                        suggest;
run;

where spelt is a fileref for the file containing the text to be spell checked and words is a libref pointing to the SAS library where the spell checker list is located. The suggest option lists spelling suggestions from the dictionary.

Verify is the default and is assumed unless a custom catalog is being created or updated with Proc SPELL.

To be more useful, a custom dictionary of industry relevant words that are not in SAS' dictionary can be created. This dictionary is a SAS catalog entry and is created with the spell procedure. To create a dictionary:

  • Create a text file with the words that you want to define.
  • Put each word on a separate line.
  • Point to the SAS file that holds the dictionary catalog (if updating) or create a new catalog.
  • Point to the location of the custom word list.

The code below creates the custom word catalog. This newly created catalog includes those entries in the SAS catalog in addition to the added custom words. To add words to a custom catalog change create to update.

PROC Spell words  = "r:\bokerson\sesug 2007\condition.txt"
           create 
             dict = work.mycatalog.spell;
run;

See also:

  • Charles Patridge sconsig tip 311b
/*** TIP 00311b                                        ***/
/***  Using Tip00128a ,Proc Spell, find all combination***/
/***    of letters that compose a valid word composed  ***/
/***    of 3 or 4 letters from a phone number.         ***/
/***                                                   ***/
/***  This is a FUN exercise not a real application    ***/

http://www.sconsig.com/sastips/tip00311b.htm

--macro maven == the radical programmer 17:32, 26 August 2008 (EDT)

Personal tools