seeking help with matching two files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

seeking help with matching two files

thara vardhan-2
Dear List members

I would be grateful if any member could help me solve this problem:

I have two files -

1. Person victims - 3818 records

2. Organisation victims - 1063

Both of them have duplicate records on the IncidentRefNum because some
incidents can have more than one person victim. The person victims are
identified by PersonCNI variable. Likewise the organisations victims file
also has incident ref number with two victims identified by PartyCNI
variable.

I do need all the records in the final file because essentially I am
trying to compile a final list of victims based on the "involvement
status" variable in each file.  Plus there are incidents that have a
person as well as an orgn as victims.

I tried to merge them using the data/merge files/add variables function.
The key variable is the Increfnum

How ever I get the following warnings

DATASET ACTIVATE DataSet14.
MATCH FILES /FILE=*
 /FILE='DataSet13'
 /RENAME (EventRefNum PrimaryFirst UniqueParties = d0 d1 d2)
 /BY IncidentRefNum
 /DROP= d0 d1 d2.
EXECUTE.
File #1
     KEY: 26669895

>Warning # 5132
>Duplicate key in a file. The BY variables do not uniquely identify each
case on the indicated file. Please check the results carefully.

File #2
     KEY: 28383475

>Warning # 5132
>Duplicate key in a file. The BY variables do not uniquely identify each
>case on the indicated file. Please check the results carefully.

DATASET ACTIVATE DataSet5.
DATASET CLOSE DataSet14.

The merged result file has only 3933 records.

Can anyone help me solve this problem please?

Thanks
regards
Thara Vardhan
Senior Statistician
Performance improvement and Planning





















Thara Vardhan
Senior Statistician
Planning & Results
Organisation Review and Support
NSW Police
Tel: (02) 8835-8526
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s)
only. It may contain private, confidential, copyright or legally privileged
information.  If you are not the intended recipient or you have received this
email by mistake, please reply to the author and delete this email immediately.
You must not copy, print, forward or distribute this email, nor place reliance
on its contents. This email and any attachment have been virus scanned. However,
you are requested to conduct a virus scan as well.  No liability is accepted
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not
constitute a representation by the NSW Police Force unless the author is legally
entitled to do so.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: seeking help with matching two files

Richard Ristow
At 10:27 PM 5/11/2008, Thara Vardhan wrote:

>I have two files -
>
>1. Person victims - 3818 records
>2. Organization victims - 1063
>
>Both of them have duplicate records on the IncidentRefNum because
>some incidents can have more than one person victim; the person
>victims are identified by PersonCNI variable. Likewise the
>organization victims file also has incident ref number with two
>victims identified by PartyCNI variable.
>
>I tried to merge them using the data/merge files/add variables function.
>The key variable is the Increfnum:
>
>DATASET ACTIVATE DataSet14.
>MATCH FILES /FILE=*
>  /FILE='DataSet13'
>  /RENAME (EventRefNum PrimaryFirst UniqueParties = d0 d1 d2)
>  /BY IncidentRefNum
>  /DROP= d0 d1 d2.
>
>I get the following warnings
>File #1
>      KEY: 26669895
>
>>Warning # 5132
>>Duplicate key in a file. The BY variables do not uniquely identify each
>>case on the indicated file. Please check the results carefully.

In this logic, you're trying to associate each person victim with an
organization victim, and vice versa, matching by Increfnum. Is that
what you want? Might you be wanting to use the "add cases" function
instead, to get all records you currently have combined into a single file?

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: seeking help with matching two files

Clive Downs
In reply to this post by thara vardhan-2
Hi,

I'm not quite clear what you are trying to do. Could you please clarify by
posting an example of the two files, and the file you would like to end up
with.

Just show a few cases in each file, enough to show how you want to combine
the data.

Thanks

Regards

Clive.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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