home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / sasl / 5706 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.2 KB

  1. Path: sparky!uunet!news.centerline.com!noc.near.net!hri.com!spool.mu.edu!howland.reston.ans.net!paladin.american.edu!auvm!ALBNYDH2.BITNET!MSZ03
  2. From: MSZ03@ALBNYDH2.BITNET (Mike Zdeb)
  3. Newsgroups: bit.listserv.sas-l
  4. Subject: PROC SQL
  5. Message-ID: <SAS-L%93012111495446@UGA.CC.UGA.EDU>
  6. Date: 21 Jan 93 16:46:58 GMT
  7. Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. Reply-To: Mike Zdeb <MSZ03@ALBNYDH2.BITNET>
  9. Lines: 41
  10. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  11.  
  12. SQL help please - the following gives me matched records plus all
  13. unmatched records from datasets ONE and TWO.  I want to restrict
  14. the content of BOTH to:  matched records (id1=id2) + all unmatched
  15. records from dataset TWO + unmatched records from dataset ONE where
  16. drg1 = '300'.  As an SQL neophyte, no matter what SQL expression I try,
  17. I don't get the desired result. (HOWARD S. HELP !!!!!!!)
  18. -----------------------------------------------------------------------
  19.  
  20. options nocenter;
  21.  
  22. data one;
  23. input
  24. @1 id1  $char3.
  25. @5 var1 $char3.
  26. @9 drg1 $char3.;
  27. cards;
  28. 123 on1 300
  29. 234 on2 200
  30. 345 on3 300
  31. ;
  32. run;
  33.  
  34. data two;
  35. input
  36. @1 id2  $char3.
  37. @5 var2 $char3.
  38. @9 drg2 $char3.;
  39. cards;
  40. 123 tw1 300
  41. 456 tw2 300
  42. ;
  43. run;
  44.  
  45. proc sql;
  46. create table both as
  47. select *
  48. from one full join two
  49. on id1 = id2;
  50.  
  51. proc print data=both;
  52. run;
  53.