Online File

How to use this page


Tech: The Dictionary Page Project

dalpha.sas
Program file
Alphabetic list from large text sample


*
  dalpha.sas
  Create list of web pages for dictionary.
  Rick Aster   February 2, 2003
*;
filename sample 'c:\My Documents\dpage\sample.txt'
filename alpha 'c:\My Documents\dpage\alpha.txt';

* 
  Read text sample. 
*;
data wordlist (keep=word);
   retain alphabet 'abcdefghijklmnopqrstuvwxyz';
   length word $ 2;
   infile sample flowover;
   input word @@;
   word = lowcase(word);
   * Verify that word contains only letters. ;
   if verify(word, alphabet) then delete;
   * In v. 9: if notalpha(word) then delete ;
   * Save first 2 letters and first letter of word. ;
   output;
   word = substr(word, 1, 1);
   output;
run;
*
  Create alphabetic list. 
*;
proc sort data=wordlist out=alphalist nodupkey;
   by word;
run;
*
  Save as text file for review.
*;
data _null_;
   set alphalist;
   file alpha;
   put word;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Techniques

Projects

Dictionary Page

Also see:

Dictionary

Start Here

Q & A

Rick Aster