home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / bit / listserv / sasl / 3758 < prev    next >
Encoding:
Text File  |  1992-08-17  |  2.2 KB  |  72 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!psuvm!auvm!LOBBY.TI.COM!RSNYDER
  3. X-Mailer: ELM [version 2.2 PL16]
  4. Message-ID: <9208171710.AA28012@ti.com>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Mon, 17 Aug 1992 12:10:36 CDT
  7. Reply-To:     "R. Snyder" <rsnyder@LOBBY.TI.COM>
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         "R. Snyder" <rsnyder@LOBBY.TI.COM>
  10. Subject:      Re: SQL delete statement
  11. Comments: To: macq@MIGUEL.LLNL.GOV
  12. Comments: cc: sas-l@uga.cc.uga.edu
  13. In-Reply-To:  <9208171652.AA27241@ti.com>; from "Don MacQueen" at Aug 17,
  14.               92 4:36 pm
  15. Lines: 55
  16.  
  17. Don MacQueen writes:
  18. >
  19. > I have a very large dataset, from which I would
  20. > like to delete a number of observations. This dataset
  21. > is large enough that I am running short on disk space.
  22. > The information about which cases to delete comes from
  23. > another dataset, based on some key variables.
  24. >
  25. > Normally, I would do something like this:
  26. >
  27. > data new;
  28. >   merge big dels (in=indel);
  29. >   by area analyte;
  30. >   if indel then delete;
  31. >   run;
  32. >
  33. > Where there are many observations in big for each
  34. > combination of area and analyte, but each combination
  35. > of area and analyte only appears once in dels.
  36. >
  37. > I thought I'd look at proc sql. Seems like something such
  38. > as
  39. >
  40. > proc sql;
  41. >   delete from big
  42. >     where big.area=dels.area and big.analyte=dels.analyte;
  43. >
  44. > ought to work, but It doesn't, and I don't know SQL well enough
  45. > to fix it.
  46. >
  47. > Help please?
  48. > Other non-sql suggestions?
  49. >
  50. > There are several hundreds of observations in dels, >200,000
  51. > observations in big. I'd like to make the deletions without
  52. > writing a big temporary file (very dangerous, I know, but
  53. > I can always go back and re-create big from the original ascii
  54. > file).
  55. > --
  56. > ---------------------------------------------------
  57. > Don MacQueen                   macq@miguel.llnl.gov
  58. > Lawrence Livermore Nat. Lab.
  59. > 7000 East Ave., L-307          (510) 423-1062
  60. > Livermore, CA 94550
  61. > ---------------------------------------------------
  62. >
  63. Don,
  64.  
  65. Try this to complete the join:
  66.  
  67.  proc sql;
  68.    delete from big, dels
  69.      where big.area=dels.area and big.analyte=dels.analyte;
  70.  
  71. Bob Snyder, Texas Instruments, Sherman, TX
  72.