home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!uwm.edu!psuvax1!psuvm!auvm!LOBBY.TI.COM!RSNYDER
- X-Mailer: ELM [version 2.2 PL16]
- Message-ID: <9208171710.AA28012@ti.com>
- Newsgroups: bit.listserv.sas-l
- Date: Mon, 17 Aug 1992 12:10:36 CDT
- Reply-To: "R. Snyder" <rsnyder@LOBBY.TI.COM>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: "R. Snyder" <rsnyder@LOBBY.TI.COM>
- Subject: Re: SQL delete statement
- Comments: To: macq@MIGUEL.LLNL.GOV
- Comments: cc: sas-l@uga.cc.uga.edu
- In-Reply-To: <9208171652.AA27241@ti.com>; from "Don MacQueen" at Aug 17,
- 92 4:36 pm
- Lines: 55
-
- Don MacQueen writes:
- >
- > I have a very large dataset, from which I would
- > like to delete a number of observations. This dataset
- > is large enough that I am running short on disk space.
- > The information about which cases to delete comes from
- > another dataset, based on some key variables.
- >
- > Normally, I would do something like this:
- >
- > data new;
- > merge big dels (in=indel);
- > by area analyte;
- > if indel then delete;
- > run;
- >
- > Where there are many observations in big for each
- > combination of area and analyte, but each combination
- > of area and analyte only appears once in dels.
- >
- > I thought I'd look at proc sql. Seems like something such
- > as
- >
- > proc sql;
- > delete from big
- > where big.area=dels.area and big.analyte=dels.analyte;
- >
- > ought to work, but It doesn't, and I don't know SQL well enough
- > to fix it.
- >
- > Help please?
- > Other non-sql suggestions?
- >
- > There are several hundreds of observations in dels, >200,000
- > observations in big. I'd like to make the deletions without
- > writing a big temporary file (very dangerous, I know, but
- > I can always go back and re-create big from the original ascii
- > file).
- > --
- > ---------------------------------------------------
- > Don MacQueen macq@miguel.llnl.gov
- > Lawrence Livermore Nat. Lab.
- > 7000 East Ave., L-307 (510) 423-1062
- > Livermore, CA 94550
- > ---------------------------------------------------
- >
- Don,
-
- Try this to complete the join:
-
- proc sql;
- delete from big, dels
- where big.area=dels.area and big.analyte=dels.analyte;
-
- Bob Snyder, Texas Instruments, Sherman, TX
-