home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!usc!wupost!psuvax1!psuvm!auvm!SWIRL.MONSANTO.COM!GIBES
- Message-ID: <9301051939.AA24929@tin.monsanto.com>
- Newsgroups: bit.listserv.sas-l
- Date: Tue, 5 Jan 1993 13:39:03 -0600
- Reply-To: Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Kernon Gibes <gibes@SWIRL.MONSANTO.COM>
- Subject: RE: Match Merge Problem
- Comments: To: SAS-L@uga.cc.uga.edu@tin.monsanto.com
- Comments: cc: GIBES@tin.monsanto.com
- Lines: 41
-
- In reply to a data merging question by Dr. Francis Dane, Ron Fehd wrote,
- in part:
-
- >well, looks like you may have a problem with your version.
-
- and I agree that a straightforward merge should have worked, but in
- Ron's single data step solution:
-
- >now here's another data build solution with arrays and retain:
- >
- >DATA PEOPLE;
- > set <something>;
- > by Pt# NCode;
- > retain VarA1 VarA2 ... VarAn
- > VarB1 VarB2 ... VarBn 0;
- > select(NCode);
- > when (1);
- > when (2) do; VarA2 = VarA1;
- > VarB2 = VarB1; end;
- > when (3) do; VarA3 = VarA1;
- > VarB3 = VarB1; end;
- > ...
- > when (N) do; VarAN = VarA1;
- > VarBN = VarB1; end;
- > otherwise; end;
- > if last.NCode then output;
-
- It seems to me that the "last.NCode" should probably be a "last.Pt#",
- but the larger issue is that this code would appear to propagate the
- values of VarA1, VarB1 in an unintended fashion, i.e. yielding:
-
- OBS PT# VARA1 VARB1 NCODE VARA2 VARB2
-
- 1 12 85 50 2 85 50
- 2 13 70 80 1 85 50
-
- I think a more elaborate retain/variable assignment would be required to
- fix the single data step solution.
-
- Kernon Gibes
- Internet: gibes@swirl.monsanto.com
-