Get records from one big table where match in other table

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Posts: 1
Joined: Tue Mar 06, 2012 2:18 pm

Get records from one big table where match in other table

Postby dieffen » Tue Mar 06, 2012 3:01 pm

Preface by saying I am a novice to the spss syntax. I have one huge table that has a lot of records that I don't need to analyze and I wanted to create a new table with just the records that I need. The big table has about 10 million records in it. There is a field in that table that uniquely identifies the person but that person can be in that table many time. I have a second table (a little over 7K records)that has the ID's of the people that I want out of the big table. The ID values are listed only once in the second table.

So what I am looking for is the full record (all variables) from the big table that match the second table. So the 10 million would be pair down to say 30K records since the selected person in the big table is listed multiple times.

Below is what I tried but I just got the 10 million records as a result.

GET FILE="unique_inpatients.sav".

GET FILE="b_carrier.sav".

MATCH FILES FILE="b_carrier.sav" /TABLE="unique_inpatients.sav" /BY DESY_SORT_KEY.

Thanks for any help,

Who is online

Users browsing this forum: No registered users and 1 guest