Matching\ Merging

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

Matching\ Merging

Deepanshu Bhalla
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Matching\ Merging

David Marso
Administrator
'I want *Info* variable updated ...'
Use the UPDATE command instead of MATCH FILES.
The Syntax is almost identical.
---
Deepanshu Bhalla wrote
Hi Team,
I have 2 data files . One with the following variables & cases :

Code Info
1 1
1 1
2 1
2 1
3 1
3 1
4 1
4 1
5 2
5 2
6 1
6 1

Another one with the following cases and variables :

Code Info
1       1
2       2
3       3
4       1
5       1
6       2

I want *Info* variable updated in the first data file from the *Info* variable of second data file.

Using the below syntax . It isn't throwing any error but Info variable is not updating.

SORT CASES BY Code.

MATCH FILES File  = *
/ TABLE = " C:\Documents and Settings\Deepanshu\Desktop\Keeper Info.sav"
/ BY Code.
EXECUTE .

When i am deleting *Info* variable from the first data file before matching the syntax is working perfectly fine .

DELETE VARIABLES Keeper.

I wanna know the reason why the syntax isn't working without deleting *Info* variable .


Below the output which i am looking for :

Code Info
1 1
1 1
2 2
2 2
3 3
3 3
4 1
4 1
5 1
5 2
6 2
6 2
 

Thanks in advance !
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Matching\ Merging

Deepanshu Bhalla
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Matching\ Merging

David Marso
Administrator
Oops my bad ;-)
Try the following (RENAME and DROP will do the trick).
MATCH FILES /FILE='file1.sav' /rename info=@ / TABLE * / by code / drop @.
-------
Context:

data list free /Code Info.
begin data
1 1
1 1
2 1
2 1
3 1
3 1
4 1
4 1
5 2
5 2
6 1
6 1
end data.
save outfile 'file1.sav'.
list.

*Another one with the following cases and variables :.
data list free /Code Info.
begin data
1       1
2       2
3       3
4       1
5       1
6       2
end data.
list.
MATCH files /FILE='file1.sav' /rename info=@ / TABLE * / by code / drop @.
list.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"