[EpiData-list] merging of files

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Thu May 3 14:18:36 CDT 2012


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 at 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




More information about the EpiData-list mailing list