Merging files

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

Merging files

Bob Schacht-3
Using Merge Files/add cases from the menu, my files get matched up on the
key variable, but I get a long list of "unpaired variables." Yet, when I
highlight some of the variables and try to add them to the variables in the
new active data set, I sometimes get the "error" message that "Name already
appears in the working data file." How can this be, if this is a list of
"unpaired" variables? Why won't these variables pair up?

Bob Schacht

=====================
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: Merging files

Richard Ristow
At 05:35 PM 4/17/2009, Bob Schacht wrote:

Using Merge Files/add cases from the menu, my files get matched up on the
key variable, but I get a long list of "unpaired variables." Yet, when I
highlight some of the variables and try to add them to the variables in the
new active data set, I sometimes get the "error" message that "Name already
appears in the working data file." How can this be, if this is a list of
"unpaired" variables? Why won't these variables pair up?

This appears to happen when there are variables of the same name in both files, but they are incompatible for merging; for example, a character variable in one file and a numeric variable in the other. Try it with the test data posted below.

As the screen tells you, you can copy both if you rename one of them, so they become separate variables in the new file.

===================
APPENDIX: Test data
===================
*  ................................................................. .
*  .................   Test data               ..................... .

DATA LIST LIST
  /CASEID Trouble
   (N3,   F2).
BEGIN DATA.
   003     3
   005     5
   006     7
END DATA.
FORMATS CASEID (N3).
DATASET NAME Numeric.

DATA LIST LIST
  /CASEID Trouble
   (N3,   A8).
BEGIN DATA
   001    Alpha
   002    Beta
   003    Gamma
   004    Delta
   007    Eta
END DATA.
FORMATS CASEID (N3).
DATASET NAME Character.

DATASET ACTIVATE Numeric   WINDOW=FRONT.
LIST.
DATASET ACTIVATE Character WINDOW=FRONT.
LIST.

DATASET ACTIVATE Numeric   WINDOW=FRONT.

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