Hi statalist community, I need some help with merging


File A has a unique ID
File B has a unique ID

The file A and file B have some common unique IDs. Moreover, both files may have some extra unique IDs.

What I want is, treat file A as master file. Merge to file A from file B, only those IDs that are common to both file A and file B, leaving other information unmerged.


example

file A
Unique_ID varA
1 100
2 200
3 300
4 400
5 500

file B
Unique_ID varB
. 1000
2 2000
. 3000
4 4000
5 5000
6 6000

What I want after merging (master file A and using file B)
Unique_ID varA varB
1 100 .
2 200 2000
3 300 .
4 400 4000
5 500 5000
thanks
ajay