home *** CD-ROM | disk | FTP | other *** search
- 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
- From: MSZ03@ALBNYDH2.BITNET (Mike Zdeb)
- Newsgroups: bit.listserv.sas-l
- Subject: PROC SQL
- Message-ID: <SAS-L%93012111495446@UGA.CC.UGA.EDU>
- Date: 21 Jan 93 16:46:58 GMT
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- Reply-To: Mike Zdeb <MSZ03@ALBNYDH2.BITNET>
- Lines: 41
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
-
- SQL help please - the following gives me matched records plus all
- unmatched records from datasets ONE and TWO. I want to restrict
- the content of BOTH to: matched records (id1=id2) + all unmatched
- records from dataset TWO + unmatched records from dataset ONE where
- drg1 = '300'. As an SQL neophyte, no matter what SQL expression I try,
- I don't get the desired result. (HOWARD S. HELP !!!!!!!)
- -----------------------------------------------------------------------
-
- options nocenter;
-
- data one;
- input
- @1 id1 $char3.
- @5 var1 $char3.
- @9 drg1 $char3.;
- cards;
- 123 on1 300
- 234 on2 200
- 345 on3 300
- ;
- run;
-
- data two;
- input
- @1 id2 $char3.
- @5 var2 $char3.
- @9 drg2 $char3.;
- cards;
- 123 tw1 300
- 456 tw2 300
- ;
- run;
-
- proc sql;
- create table both as
- select *
- from one full join two
- on id1 = id2;
-
- proc print data=both;
- run;
-