Login  Register

Re: Merging multiple challenging files

Posted by Albert-Jan Roskam on Aug 08, 2013; 6:30am
URL: http://spssx-discussion.165.s1.nabble.com/Calculating-CI-in-SPSS-when-percentage-is-close-to-0-tp5721509p5721521.html

Hi,

APPLY DICTIONARY has an option /NEWVARS  that creates, well, new variables. If the variables are in the source dataset but not in the target dataset, they will be created. You could use that to build a (dummy) master file with all the dictionary info. Then you might still run into problems with string variables though.

 
Regards,
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a
fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


From: Jon K Peck <[hidden email]>
To: [hidden email]
Sent: Thursday, August 8, 2013 3:08 AM
Subject: Re: [SPSSX-L] Merging multiple challenging files

For numeric variables, the format is irrelevant  for the merge.  Each merged variable will have the format from the first file where it is encountered, but no data will be lost.  For string variables the widths do have to match, unfortunately, but the STATS ADJUST WIDTHS extension command available from the SPSS Community site can synchronize strings widths across files.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        MR <[hidden email]>
To:        [hidden email],
Date:        08/07/2013 06:59 PM
Subject:        [SPSSX-L] Merging multiple challenging files
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Friends,

I have been using SPSS for a while along with Syntax but just couldn't figure out easy solution to following issue:

Issue: I need to APPEND or add 10+ data files. Files do share few common variables but each file also has new variables. For e.g., file 1 has 10 common variables but 30 new variables only unique to this file.

I can easily add the files but the issue is that each file has different number format for common variables. For e.g., VAR1 is F30 in file 1 but F40 in file 2 and so on.

Objective:
1. Create long list of variables that covers all variables across 10 files. THis will be master long list of variables
2. Get maximum value of column width and apply to all common variables across files. For e.g., if VAR1 is F30 in file 1 and f40 in file 2 then file 1 VAR1's should be replaced as F40. Currently, I am doing this in excel by comparing data dictionary of all 10 files and it is soul destroying process.
3. Once variable format is same across files, I would then append all the files in one go.

I tried to find solution on spss tools net but couldn't find anything, except comparing two datasets which really doesn't solve my problem.

Any help is greatly appreciated - Jon P, I would appreciate if you can share your expertise here.

Manmit

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