After the Merge Problem

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

After the Merge Problem

angelini
I wrote this posting earlier "After the Merge":
I used the merge data/add variable function of SPSS. The shared variable of
the two files was UIC and the variable added was Zip Code. The variable Zip
Code merged fine but it only merged the Zip Code of the first record. This
leaves me with many blank records like this:

UIC      ZIPCODE
30045    92127
30045
30045
30045
30046    54561

I was given a solution using Syntax on behalf of Jim Marks: not sure how to
do that.

I was also given a solution using the menu list Data/Merge Files which did
not work.

Any help appreciated!
Phil
Reply | Threaded
Open this post in threaded view
|

Re: After the Merge

Richard Ristow
At 05:00 PM 5/4/2007, Phil Angelini wrote:

>I wrote this posting earlier "After the Merge": The shared variable of
>the two files was UIC and the variable added was Zip Code. The
>variable Zip Code merged fine but it only merged the Zip Code of the
>first record.
>
>I was given a solution using Syntax on behalf of Jim Marks: not sure
>how to
>do that.
>
>I was also given a solution using the menu list Data/Merge Files which
>did not work.

Well, I gave you the solution using the menus, so I should be this a
go. But telling us it "did not work" isn't enough to go on. (See
"Recommendations, when posing a question", Ristow, Tue, 17 Apr 2007
<13:06:41 -0400>)

- What happened? Did it not work at all, or did it seem to work but not
give you what you wanted. What did it give you?

- Try again. Take notes of exactly what you check, enter, or select for
every choice in every panel of the Data/Merge Files, and report that.

- The menus generate and run syntax. Post the listing that has the
syntax and any error messages.

Good luck, let us know, and I'm sure this is manageable,
Richard
Reply | Threaded
Open this post in threaded view
|

Re: After the Merge Problem

meljr
In reply to this post by angelini
Hi again Phil, are you opening a sytax file and putting the code it there?
The suggestion I made in my email to you was that you use the lag funtion, something like this:

If (UIC = lag(UIC)) ZIPCODE = lag(ZIPCODE).

Your UIC values would have to be sorted, and the first occurance would have to contain the ZIPCODE.
If you are not using a syntax file, you will have to figure out how to do that.
Then practice the lag funtion to make sure you can get it to work for you.

I use the lag type of syntax alot, and it should work for your data.
I am sure the other suggestions would work equally as well, however, sometimes it is a trick to get them to work.

Don't just keep trying the methods on your real data, set up a small practice data set and work with that until you can see the syntax work for you.

Hope this helps a bit.

meljr
angelini wrote
I wrote this posting earlier "After the Merge":
I used the merge data/add variable function of SPSS. The shared variable of
the two files was UIC and the variable added was Zip Code. The variable Zip
Code merged fine but it only merged the Zip Code of the first record. This
leaves me with many blank records like this:

UIC      ZIPCODE
30045    92127
30045
30045
30045
30046    54561

I was given a solution using Syntax on behalf of Jim Marks: not sure how to
do that.

I was also given a solution using the menu list Data/Merge Files which did
not work.

Any help appreciated!
Phil
Reply | Threaded
Open this post in threaded view
|

Re: After the Merge Problem

angelini
In reply to this post by angelini
Using the lag command worked great. I first tried it on a small selection
of cases and then on the 50,000 record file. Thanks much for your advice.
This will save me a lot of time.