LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 21 Sep 2009 18:23:34 -0400
Reply-To:   Richard Ristow <wrristow@mindspring.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Richard Ristow <wrristow@mindspring.com>
Subject:   Re: keyed table merge not working
Comments:   To: Dennis Deck <DDeck@rmccorp.com>
In-Reply-To:   <EFCF16377594714C9B2B3A8CFC31615D0139031D@svrmail.RMC.local >
Content-Type:   text/html; charset="us-ascii"

<html> <body> At 07:41 PM 9/17/2009, Dennis Deck wrote:<br><br> <blockquote type=cite class=cite cite="">A simpler approach would be to first create a master file of all the IDs and then merge the ID, pre, and post files : </blockquote><br> It's a good idea; but it won't work in cases like this one, where one or both of the two files can have multiple records for the same ID:<br><br> <tt><font size=2>MATCH FILES<br> &nbsp;&nbsp; File= IDfile<br> &nbsp; /Table= table_1&nbsp; /In=In_1<br> &nbsp; /Table= table_2&nbsp; /In=In_2<br> &nbsp;&nbsp;&nbsp;&nbsp; /BY ID .<br> DATASET NAME Combined .<br> File #3<br> &nbsp;&nbsp;&nbsp;&nbsp; KEY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1<br><br> &gt;Error # 5131<br> &gt;Duplicate key on a TABLE file.&nbsp; Each case on a TABLE file in<br> &gt;MATCH FILES must be uniquely identified by the BY variables.<br> &gt;This command not executed.<br><br> </font></tt>=====================<br> APPENDIX: Code tested<br> =====================<br> This uses datasets 'table_1' and 'table_2' that were the test data in my previous posting.<br><br> <tt><font size=2>ADD FILES<br> &nbsp; /File=table_1 <br> &nbsp; /File=table_2 <br> &nbsp;&nbsp;&nbsp; /Keep= ID .<br> &nbsp;<br> AGGREGATE&nbsp; Outfile=* <br> &nbsp;&nbsp;&nbsp;&nbsp; /Break= ID <br> &nbsp;&nbsp;&nbsp;&nbsp; /NOccur=NU.<br><br> DATASET NAME IDfile .<br><br> MATCH FILES <br> &nbsp;&nbsp; File= IDfile<br> &nbsp; /Table= table_1&nbsp; /In=In_1<br> &nbsp; /Table= table_2&nbsp; /In=In_2<br> &nbsp;&nbsp;&nbsp;&nbsp; /BY ID . <br> DATASET NAME Combined .</font></tt> </body> <br> </html>

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


Back to: Top of message | Previous page | Main SPSSX-L page