Statalist The Stata Listserver


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

st: merge problem; need help


From   "Diane Arapovic" <[email protected]>
To   [email protected]
Subject   st: merge problem; need help
Date   Mon, 08 Jan 2007 14:42:34 +0100

Hello,
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___


Probably it�s a beginner question and I�m sorry if someone feels disturbed I'm asking this in the stata-list. But I really can�t find out what�s the reason for the error. I checked already all possible help files in my program and in the web, tried the command with other datasets,  asked for help at my university but they couldn�t find out either what�s the problem. Maybe someone of you guys has any idea/suggestion that could help me?
Thanks, 
Diane


-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal f�r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
*
*   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