pspp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matching 2 files...Simple Question?


From: John Darrington
Subject: Re: Matching 2 files...Simple Question?
Date: Sat, 5 Jun 2010 10:23:51 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

All the subcommands except /FILE and /BY are optional (as indicated in the 
manual).
/FILE indicates the sources you want to match. /BY indicates the variable (which
should exist in both sources) upon which you want to perform the match.

The optional /IN subcommand, according to the manual "... creates a numeric 
variable ... which
takes the value 1 ... if the input file contributed to that case, and 0 
otherwise".

For example try the following snippet.

        * Create file1.

        new file.
        data list notable list /code * x *.
        begin data.
        90 0
        91 1
        92 2
        93 3
        end data.

        save outfile='file1'.



        * Create file2.
        new file.

        data list notable list /code * y *.
        begin data.
        92  22
        93  23
        94  24
        95  25
        96  26
        end data.

        save outfile='file2'.


        * clear the working dataset
        new file.

        * Join file1 and file2 on their CODE variable, and leave the result in 
the
          working dataset.  Additionally, create two new variables, FROM1 and 
FROM2
          which indicate the source of each observation.

        match files 
                /file='file1'
                /in=from1
                /file='file2'
                /in=from2
                /by=code.

        list.


On Fri, Jun 04, 2010 at 06:01:28AM -0700, Clarry wrote:
     
     Hi, 
     
     I am very new to PSPP and have no knowledge of Syntax, although i can see
     the logic of something once shown. 
     
     I have looked at the manual, at this: 
     
     MATCH FILES 
     /{FILE,TABLE}={*,???file-name???} 
     /RENAME=(src names=target names). . . 
     /IN=var name 
     /BY=var list 
     /DROP=var list 
     /KEEP=var list 
     /FIRST=var name 
     /LAST=var name 
     /MAP 
     
     
     but have no idea what to do with IN, BY, DROP, etc. Or the conventions 
used. 
     
     If someone uses the parameters required to match one variable (let's call 
it
     "CODE") from File 1 to the same variable in File 2 then rename the new file
     File 3, I would be able to adapt. 
     
     
-- 
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.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]