Am I missing something? Isn't this just the cross product of the two datasets?
clear
input str1 y byte z
a 7
b 8
c 9
end
tempfile tmp
save `"`tmp'"'
clear
input byte id byte x
1 4
2 6
3 7
end
cross using `"`tmp'"'
sort id y
list, sepby(id)
+----------------+
| id x y z |
|----------------|
1. | 1 4 a 7 |
2. | 1 4 b 8 |
3. | 1 4 c 9 |
|----------------|
4. | 2 6 a 7 |
5. | 2 6 b 8 |
6. | 2 6 c 9 |
|----------------|
7. | 3 7 a 7 |
8. | 3 7 b 8 |
9. | 3 7 c 9 |
+----------------+
Joseph
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/