Announcement

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

  • Problem with Merging

    Hi,

    I am trying two merge two datasets using the key ID (Neighborhood_Code).
    However, Im getting the error
    " Each key variable -- the variables on which observations are matched -- must be of the same generic type in the master and using datasets. Same generic
    type means both numeric or both string."

    The key ID is a combination of numbers like '110111110901'.

    In the first dataset, the ID format is %18.0g and in the second %12s.
    I want both to be stored as string before merging.
    How should I do that ?

  • #2
    In the file with numeric identifiers, genarate a string identifier:

    Code:
    gen SID= string(ID, "%18.0f")

    and then rename both (or either) string identifiers so that their names match.

    Comment


    • #3
      It worked, thanks Adrew!

      Comment

      Working...
      X