What do the details in this warning mean?

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

What do the details in this warning mean?

karen lewis
I selected cases, copied to a new database, and got this warning:



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.

NEW FILE.

DATASET ACTIVATE DataSet1.

DATASET COPY  untitled2.

DATASET ACTIVATE  untitled2.

FILTER OFF.

USE ALL.

SELECT IF (CRACEM01 = 3).

DATASET ACTIVATE  DataSet1.

EXECUTE.



What are the "BY" variables, and how is it that they "do not uniquely
identify each case on the indicated file"?



This is a data set with close to 1k variables that I am still familiarizing
myself with, and I am a novice.  Gentle responses (i.e., basic) are mostly
appreciated.



Thank you,

Lewis

=====================
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: What do the details in this warning mean?

Albert-Jan Roskam
Hi,

That's a warning of the MATCH FILES command. I don't understand why you got it with the syntax you provided. I you want to link two datasets on the basis of, say, social security number (snn) then snn is your BY variable. But if snn is not unique in either or both datasets (two or more records with the same ssn), you can't simply link the datasets. The solution is a TABLE lookup match:
MATCH FILES / FILE = 'non_unique.sav' / TABLE = 'unique.sav' / BY = ssn.
Both datasets need to be sorted on the BY variable.

Cheers!!
Albert-Jan



--- On Wed, 11/26/08, karen lewis <[hidden email]> wrote:

> From: karen lewis <[hidden email]>
> Subject: What do the details in this warning mean?
> To: [hidden email]
> Date: Wednesday, November 26, 2008, 12:57 AM
> I selected cases, copied to a new database, and got this
> warning:
>
>
>
> 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.
>
> NEW FILE.
>
> DATASET ACTIVATE DataSet1.
>
> DATASET COPY  untitled2.
>
> DATASET ACTIVATE  untitled2.
>
> FILTER OFF.
>
> USE ALL.
>
> SELECT IF (CRACEM01 = 3).
>
> DATASET ACTIVATE  DataSet1.
>
> EXECUTE.
>
>
>
> What are the "BY" variables, and how is it that
> they "do not uniquely
> identify each case on the indicated file"?
>
>
>
> This is a data set with close to 1k variables that I am
> still familiarizing
> myself with, and I am a novice.  Gentle responses (i.e.,
> basic) are mostly
> appreciated.
>
>
>
> Thank you,
>
> Lewis
>
> =====================
> 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

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