Announcement

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

  • Append datasets horizontally without generating _n

    Hi, I wanted to append two datasets horizontally. However, I can't do merge them with _n properly because I think the dataset is very large: 180,453,364 observations are included in each dataset, and the numbers generated by _n seem erroneous when they exceeds a certain number.

    Could someone tell me how I can append datasets without an identifier?

  • #2
    I don't understand what you are trying to do. Where is this _n being generated? It is not done by -merge-. And you don't need any such variable to use -merge-. To -merge- two data sets you need a variable, or set of variables, that serves as a merge key that matches up observations in one data set with the observations in another.

    If, however, for other reasons, you want to generate a variable that contains the observation number, and your data set is large, then you have to specify its storage type as long:

    Code:
    gen long obs_num = _n

    Comment

    Working...
    X