home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / bit / listserv / sasl / 4003 < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.0 KB  |  52 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!MCIMAIL.COM!0001007026
  3. Message-ID: <05920903030750/0001007026ND1EM@mcimail.com>
  4. Newsgroups: bit.listserv.sas-l
  5. Date:         Thu, 3 Sep 1992 03:07:00 GMT
  6. Reply-To:     Joseph A Schunk <0001007026@MCIMAIL.COM>
  7. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. From:         Joseph A Schunk <0001007026@MCIMAIL.COM>
  9. Subject:      re: sql questions
  10. Lines: 40
  11.  
  12. >Date:     Wed Sep 02, 1992  4:01 pm  PDT
  13. >From:     Ray Pass
  14. >Subject:  Finding non-dups via SQL
  15. >I need two listings, one showing the cases in FILE1 that
  16. >aren't in FILE2, and the other, obviously showing those in FILE2 that aren't
  17. >in FILE1.  I don't want to see the dups.  The only var that I care about in
  18. >matching is CASENO.  In other words I only want to match on the key CASENO.
  19.  
  20. Have you tried the relational operator EXCEPT:
  21.  
  22. proc sql;
  23.    title1 'Cases in file1 and not in file2';
  24.    select caseno from file1
  25.      except
  26.    select caseno from file2
  27.    ;
  28.  ... PROC ETC ...
  29.  
  30. >Date:     Wed Sep 02, 1992  5:48 pm  PDT
  31. >From:     Jim Clark
  32. >Subject:  SQL again - Conflict between WHERE and OBS option
  33. >54             select
  34. >55               max(dep), max(crs), max(sec), max(ins), 0, ., ., ., ., .,
  35. >max(n), mean(mn)
  36. >56               from freq
  37. >57               where qn<26
  38. >58               group by dep, crs, sec, ins;
  39. >ERROR: A where clause may not be used with the FIRSTOBS or the OBS data set
  40.  
  41. In all procs WHERE and OBS/FIRSTOBS are mutually exclusive. HOWEVER, look
  42. at the PROC SQL <options>; there is one to control the number of
  43. observations (I think) and the number of loops (essentially a "govenor" of
  44. sorts).
  45.  
  46.   +------------------------------------------------------------+
  47.   |  MCI Mail:  JSchunk or 100-7026                            |
  48.   |  Telex (MCI/WUI): 6501007026   Ans: 6501007026MCI UW       |
  49.   |  Internet:  JSchunk@MCIMail.Com                            |
  50.   |  X.400: G=joseph; S=schunk; ADMD=mci; C=us;                |
  51.   +------------------------------------------------------------+
  52.