Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: merge problem; need help


From   n j cox <[email protected]>
To   [email protected]
Subject   st: merge problem; need help
Date   Mon, 08 Jan 2007 13:53:32 +0000

-unab- is part of official Stata and should be available
to you. My guess is that your installation of
Stata is corrupt in some way. You could try directly

. which unab

Nick
[email protected]

Diane Arapovic

I�m having a problem merging two datasets. One contains information about marital status of each respondant (biomarsyNeu1.dta) and the other one contains basic information about each respondant, like sex, year of birth, nationality etc.. (ppfadNeu.dta).
In both datasets there is a person indentify number called persnr, which is even recommended by the data-manual as the key variable for merging two or more datasets.
But whenever I try to combine them stata failes, showing:
unrecognized command: unab.
error code 199:

*These are the commands I�m using to combine the datasets:
use ppfadNeu.dta, clear
sort persnr
save ppfadNeu.dta, replace
use biomarsyNeu1.dta
sort persnr
merge persnr using ppfadNeu.dta

unrecognized command: unab
r(199)

*checking what Stata is doing:
set trace on
merge persnr using ppfadNeu.dta
______________________________________________________begin merge_________
- version 8.2
- gettoken first 0: 0
- while (`"`first'"' != "using" & `"`first'"' != "") {
= while (`"persnr"' != "using" & `"persnr"' != "") {
- local vlist "`vlist' `first'"
= local vlist " persnr"
- gettoken first 0: 0
- }
- while (`"`first'"' != "using" & `"`first'"' != "") {
= while (`"using"' != "using" & `"using"' != "") {
local vlist "`vlist' `first'"
gettoken first 0: 0
}
- if "`vlist'" != "" {
= if " persnr" != "" {
- unab vlist : `vlist'
= unab vlist : persnr
unrecognized command: unab
foreach var of local vlist {
capture confirm variable `var'
if _rc {
di as err "variable `var' not found"
exit 111
}
}
}
_____________________________________________________________end merge___



*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index