Merging data files

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

amir.djv
Posts: 26
Joined: Thu May 03, 2012 3:48 pm

Merging data files

Postby amir.djv » Mon Jul 23, 2012 7:19 am

Hey,

I'm working on a yearly (not longitude, so it's not that same people each year) school research with multiplies data files. Unfortunately the once before me, weren't much organized. So, some of the variables doesn't have the same names etc.

My mission is to create a new data file which contains the same variables from the different files. I computed a fixed YEAR variable on each file, and I looked and changed variables names in each files so the names would be the same.

What command should I use (syntax?) to marge the files and how can I check if the files been merged correctly?.

Thank you! : )
Penguin_Knight
Posts: 473
Joined: Thu Apr 05, 2012 5:58 pm

Re: Merging data files

Postby Penguin_Knight » Mon Jul 23, 2012 12:53 pm

Maybe Transform > Merge Files > Add Cases?
Erikyo
Posts: 28
Joined: Mon Mar 30, 2009 8:20 pm

Re: Merging data files

Postby Erikyo » Mon Jul 23, 2012 1:11 pm

Amir,

Like Penguin_knight said, simply Data - Merge Files - Add cases, then you can select whether it's an open dataset or you can browse to select it.

Then, since you probably have done a good job in making sure all the variables in all the files look alike, have the same name and everything. It might still tell you that some variables will not be included. That could be a problem and it often happens with string variables.

If that happens, you might wanna go back to make sure all your strings have the same width. A command such as the following should do the work :

ALTER TYPE
Comment(A1000).
EXECUTE.

This Alter type command will set the width of the variable 'Comment' to 1,000 characters! (Make sure you know the width needed so that nothing gets truncated !

Hope this helps !

Who is online

Users browsing this forum: No registered users and 1 guest

cron