Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • merge strL - needs a better error message

    This code

    Code:
    clear
    sysuse auto
    save test
    
    rename make makeshort
    generate strL make = makeshort
    
    merge 1:1 make using test
    produces this error message:

    Code:
    . merge 1:1 make using test
    variable make does not uniquely identify observations in the master data
    r(459);
    The problem is the datatype, not uniqueness!
    Doug Hemken
    SSCC, Univ. of Wisc.-Madison

  • #2
    Yes, and I can reproduce this error on my installation, Windows 7 64-bit, Stata v. 15.1 MP-2.

    Doug, what is your setup? We need a bunch of people on different setups to identify if this is a pan-Stata issue or is specific to particular versions/platforms/flavors.

    Comment


    • #3
      #1 is not clear - when I do exactly what Doug shows I get the same message; however, test.dta is the data set in memory - so I agree that the message is not the best but the problem appears to be different

      note that if I
      Code:
      sort make
      save test, replace
      sysuse auto
      . merge 1:1 make using test
      key variable make is strL in using data.
          The key variables -- the variables on which observations are matched -- can be str#, but
          they cannot be strLs.
      then I get the message shown above

      I am on a Mac with High Sierra using Stata 15.1, MP-4

      Comment


      • #4
        Windows 7, Stata 15.1, SE-64
        and
        Windows server 2008, Stata 15.0, SE-64
        and
        Windows server 2008, Stata 15.0, MP-16 64bit
        and
        Linux version 2.6.32-642.15.1.el6.x86_64 (Red Hat 4.4.7-17) , Stata 15.0, MP-16
        Doug Hemken
        SSCC, Univ. of Wisc.-Madison

        Comment


        • #5
          Rich, I found that too. It would be useful to have the same error message when strL is in master.
          Doug Hemken
          SSCC, Univ. of Wisc.-Madison

          Comment

          Working...
          X