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="C: \file2.rec" /table
savedata "C:\file3.rec " /replace
I am looking forward to hear how I can resolve this issue.
Thanks,
Renate
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
participants (1)
-
epidata-list@lists.umanitoba.ca