Looping in SPSS

Posted on 2011-05-12
Last Modified: 2013-11-15
I have a very large data set, it contains 5 files of more than 1,000,000 cases each.  I have a common field name in each file.  I need to go through one file and file all the cases in the other file which match the common field value.
Question by:heathroe2
    LVL 9

    Expert Comment

    Can you explain this with a little more detail?  I'm not sure what you mean by "file all the cases."  Are you trying to create a combined dataset?  If so, you should use the Merge Files command in the Data menu.

    Author Comment

    These are medical records.  I have a file for home health, nursing facility, inpatient hospital, ect.  I have a unique patient id.  I need to find all the patients who have home health and all of thier other claims in other settings.  Thank you
    LVL 9

    Accepted Solution

    I think Merge Files will give you what you are looking for - you can use the patient ID as a merge code so that it can link the files together, which will ultimately give you a dataset containing the patient ID and data from every other file in a single dataset.  Each file needs to be sorted in ascending order by patient ID before you begin though.

    I would, however, recommend testing it with a few hundred cases from each dataset first, until you are sure it is working correctly.  SPSS does not handle datasets that large very efficiently.

    This video looks like it might help:

    Author Closing Comment

    Thank you!

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
    This is about my first experience with programming Arduino.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now