Re: Match Files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Match Files

Hans Chen
Dear Sir or Madam

I would like the match three file up, one is working files including all
respondents info the other two files have different variable but just have
part of cases. I have tried two different syntax but got the same result. I
would like to know which way is the  right way to do the job?  Thanks!


Hans Chen



Working file is

RESPNO

 X1

X2

X3



X100

1











2











3











4











5











6











7











8











9











10

























 Q101.SAV LOOKS LIKE THIS:

RESPNO

X101

3



4



5



7



10









Q102 LOOKS LIKE THIS:



RESPNO

X101

1



2



5



7



4









MATCH FILES /FILE=*

 /FILE='C:\MY DOCUMENT\Q1.sav'

 /BY respno.

EXECUTE.

MATCH FILES /FILE=*

 /FILE='C:\MU DOCUMENT\Q2.sav'

 /BY respno.

EXECUTE.



MATCH FILES/FILE*

/TABLE="C:\MY DOCUMENT\Q1.SAV"

/TABLE="C:\MYDOCUMENT\Q2.SAV"

/BY RESPNO.

EXECUTE.


--
Hans Chen
Canada

====================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
Reply | Threaded
Open this post in threaded view
|

Re: Match Files

Richard Ristow
At 08:39 PM 3/17/2008, Hans Chen wrote:

>I would like the match three file up, one is
>working files including all respondents info the
>other two files have different variable but just
>have part of cases. I have tried two different
>syntax but got the same result. I would like to
>know which way is the  right way to do the job?  Thanks!

Do you have your own postings reflected back to
you? If you look, you'll see that your test data
came through with many, many extra line breaks:
every name and data element was on a separate
line, with many blank lines in addition. It was
essentially unreadable, which may be why you haven't had an answer.

Mildly against my better judgement (this is
really your job), I've attempted to reformat your
data so that it might be used. (If I've got it
wrong, correct and re-post.) This may make
possible a substantive response; I'm not trying one.

>Working file is:
RESPNO  X1  X2  X3 … X100
1        2   3   4   5
6        7   8   9   10
…

>  Q101.SAV LOOKS LIKE THIS:
RESPNO X101
3      4
5      7
10
-

>Q102 LOOKS LIKE THIS:
RESPNO X101
1      2
5      7
4
-

[Code that was tried is:]

MATCH FILES /FILE=*
  /FILE='C:\MY DOCUMENT\Q1.sav'
  /BY respno.

EXECUTE.

MATCH FILES /FILE=*
  /FILE='C:\MU DOCUMENT\Q2.sav'
  /BY respno.

EXECUTE.



MATCH FILES/FILE*
  /TABLE="C:\MY DOCUMENT\Q1.SAV"
  /TABLE="C:\MYDOCUMENT\Q2.SAV"
  /BY RESPNO.

EXECUTE.

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