Thanks Hans! That was the issue. Renate -----Original Message----- From: epidata-list-bounces@lists.umanitoba.ca [mailto:epidata-list-bounces@lists.umanitoba.ca] On Behalf Of epidata-list-request@lists.umanitoba.ca Sent: Friday, May 04, 2012 1:00 PM To: epidata-list@lists.umanitoba.ca Subject: EpiData-list Digest, Vol 103, Issue 2
Send EpiData-list mailing list submissions to epidata-list@lists.umanitoba.ca
To subscribe or unsubscribe via the World Wide Web, visit http://lists.umanitoba.ca/mailman/listinfo/epidata-list or, via email, send a message with subject or body 'help' to epidata-list-request@lists.umanitoba.ca
You can reach the person managing the list at epidata-list-owner@lists.umanitoba.ca
When replying, please edit your Subject line so it is more specific than "Re: Contents of EpiData-list digest..."
EpiData-list mailing list ___________________________________
Today's Topics:
1. Re: merging of files (epidata-list@lists.umanitoba.ca)
----------------------------------------------------------------------
Message: 1 Date: Thu, 03 May 2012 21:18:36 +0200 From: epidata-list@lists.umanitoba.ca Subject: Re: [EpiData-list] merging of files To: epidata-list@lists.umanitoba.ca Message-ID: 4FA2DA0C.40507@tbrieder.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Did you get it the right way around? If one person has 1 or more visits, then you read the visits file and add information from the person-file:
read "visitsfile.rec" merge uniqueid /file="presonfile.rec" /table savedata "newfile"
freq mergevar
MERGEVAR is created by EpiData and takes 3 values, only in original, only in external, in both.
Regards,
Hans
On 02-May-12 20:13, epidata-list@lists.umanitoba.ca wrote:
Hi there,
I am in the process of merging files in EpiData Analysis. I am looking
for syntax that would allow me to keep all the records in the file not
just the records that are in common in file1 (individual information) and file2 (visit information). File 2 contains only information of those that are already included in File1.
For example, file1 has a 100 records and file2 has 10. One person has 5 visits and 5 others have one record.
The merged file ideally includes all records from file1 and file2 (104
records). I have tried several options and failed as there are duplicate ID's.
Example:
close
logclose
read "C:\file1.rec"
merge id /file=: \file2.rec" /table
savedata "C:\file3.rec " /replace
I am looking forward to hear how I can resolve this issue.
Thanks,
Renate
-- Hans L Rieder, MD, MPH Jetzikofenstr 12 3038 Kirchlindach Switzerland
Tel: +41 31 829 4577 Mob: +41 79 321 9122 Web: http://www.tbrieder.org
------------------------------
________________________________________ EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
End of EpiData-list Digest, Vol 103, Issue 2 ********************************************