home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / bit / listserv / sasl / 4080 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.6 KB  |  74 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!gatech!paladin.american.edu!auvm!UMSLVMA.BITNET!NASSER
  3. Message-ID: <SAS-L%92090815373171@UGA.CC.UGA.EDU>
  4. Newsgroups: bit.listserv.sas-l
  5. Date:         Thu, 3 Sep 1992 22:40:25 CDT
  6. Reply-To:     David Nasser <NASSER@UMSLVMA.BITNET>
  7. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. From:         David Nasser <NASSER@UMSLVMA.BITNET>
  9. Subject:      *Complex* Char Comparisons
  10. Lines: 62
  11.  
  12. Content   : Question
  13. Summary   : Re: new character manipulation tricks in SAS 6.07?
  14. System(s) : MVS/ESA/SAS 6.07 et. al.
  15. Name      : David Nasser
  16.  
  17. Do we have some new 6.07 goodies that enable us to better handle
  18. *complex* character comparisons?
  19.  
  20. Specifically, if 2 poor unknown souls independently keyed in char.
  21. fields of (say) length >=40, and we need to merge and compare for
  22. _major_ differences, do we have new means of doing so?
  23.  
  24. Example of _major_ diff.:
  25. VAR1='The rain in Spain falls mainly on the plain';
  26. VAR2='THE PRECIPITATION IN ALBEQUERQUE IS TRIVIAL';
  27.  
  28. Example of _minor_ diff.:
  29. VAR1='The rain in Spain falls mainly on the plain';
  30. VAR2='THE  RAEN IN SPAIN FALLS MAINLEE  ON THE PLAIN';
  31.  
  32. Things to flag in the comparison:
  33.   Differing number of "words" (as returned by SCAN(VAR,I,' '), I=1,N).
  34.   Two or more chars that differ in any given pair of "words".
  35.  
  36. Things to ignore in the comparison:
  37.   Case.
  38.   Blanks, any number, in any position.
  39.   Single char typos (one per "word").
  40.  
  41. This sort of thing has been discussed on SAS-L before. I checked the
  42. SQL manual for "the LIKE condition": no apparent help. Seems that
  43. someone mentioned a new data step comparison operator (or was it a
  44. function??) in 6.07, but I couldn't find anything running MVS/TSO
  45. 6.07 on-line help. Ran DATABASE SEARCH on subject SOUNDEX, have yet
  46. to receive info from UGA, MARIST, or OHSTVMA.
  47.  
  48. Yes, I could code a macro to do this. Its invocation might look like:
  49.  
  50.   MERGE THISUN THATUN;
  51.    BY ID;
  52.   RC=0;
  53.  ** MACRO CCCOMP SETS RC=1 IIF *MAJOR* DIFFERENCES EXIST **;
  54.   %CCCOMP(_VAR1=VAR1,_VAR2=VAR2,_RC=RC)
  55.   IF RC;
  56.  PROC PRINT;
  57.  
  58. where the actual macro code (SCAN, SUBSTR, etc.) is doing *unspeakable*
  59. things with the _hideous and insideous_ parsing, and like dat.
  60. Noooo-bodeeeee wants to do this (if it can be avoided).
  61.  
  62. Cigar and a beer for an elegant solution. Many thanks in advance for
  63. anything thats not truly ugly. Will summarize if interest merits.
  64.  
  65.   Salut,
  66.   David
  67.  
  68. David Nasser                              NASSER@UMSLVMA
  69. St. Louis, Mo                             NASSER@UMSLVMA.UMSL.EDU
  70.  
  71. "Gimme back my wig,
  72.  And let your head go bald!!"
  73.                  Hound Dog Taylor
  74.