Thanks, that did the trick! 
For future reference for anyone with the same problem, for whom copy/paste 
attempts are as big of a disaster as they were for me, here's a 
step-by-step.

Instructions:

Open a new, empty file and then open a new syntax window and type in (of 
course using your own file names and variable names instead):
-------------------------
MATCH FILES
    /FILE='D:\basis.sav'
    /IN=z_id_basis
    /SORT
    /file='D:\reasons.sav'
    /IN=z_id_reasons
    /SORT
    /BY z_id.
-------------------------
Then click Run/All from the syntax window's menu bar. 
Then save the new file and basta, you have combined all your variables. 

Explanation:

In 'basis.sav' there are ten variables, all from my first survey, one of 
them being z_id. In 'reasons.sav', the second, follow-up survey, there were 
another dozen variables, including again the same variable z_id (basically 
a customer number). So, the above syntax just said: 
"Merge the two files 'basis.sav' and 'reasons.sav', being sure to sort each 
by ID first. Go through them case by case and make  a new file out of their 
union. Where they each have a row with a particular ID, make a row in the 
new file with all the variables from both files filled in; and where an ID 
exists only in the first but not the second file (e.g., no response to the 
follow-up), make a case with that ID anyhow but leave the variables from 
the second file as missing values. While you're at it add two new variables 
'z_id_basis' and 'z_id_reasons', and define them as '1' if their source 
file's information contributed to the new row, so you can check nothing got 
left out."

-ahl

>             
> -------- Original-Nachricht --------
> Datum: Fri, 7 Jan 2011 12:23:04 +0000
> Von: John Darrington <[email protected]>
> An: Antje Haussen Lewis <[email protected]>
> CC: [email protected]
> Betreff: Re: howto importing sorted variables into existing file
> 
>             On Thu, Dec 30, 2010 at 04:10:56PM +0100, Antje Haussen Lewis 
> wrote:
>      As a relative newbie to statistics and pspp I have not been able to 
> figure 
>      out how to do the following: 
>      
>      I have an open text response variable that I will be categorizing 
> using the 
>      Coding Analysis Toolkit (http://cat.ucsur.pitt.edu/). I want to 
> import the 
>      results (a set of around a dozen yes/no variables) into my existing 
> .sav 
>      file to exist alongside the original responses.
>      
>      Any ideas? Importing csv data only replaced the entire file, which 
> was 
>      luckily only a copy..
>      
> 
> I'm not sure from your description exactly what you're trying to do.  But 
> possibly
> the MATCH FILES command is what you're looking for.  See the manual for 
> details.
> 
> J'
> 
> -- 
> PGP Public key ID: 1024D/2DE827B3 
> fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
> See http://pgp.mit.edu or any PGP keyserver for public key.
> 
> 
> 
        
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
_______________________________________________
Pspp-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-users

Reply via email to