Announcement

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

  • Splitting a string variable into parts

    I have the following sample data.
    Code:
     
    datestoretxn_numberupcqtywgtrewa
    2017-06-21|18|2*59*1526|2114002318|1|0.0|3.28|42086775550
    2017-06-21|18|2*59*1526|3680026711|1|0.0|0.79|42086775550
    2017-06-21|18|2*59*1526|61300872056|1|0.0|2.99|42086775550
    2017-06-21|18|2*59*1526|7332107141|2|0.0|4.99|42086775550
    I would like to split the string variable into the 8 variables separated by |. I tried the following code but obtained an error "cannot generate new variables using stub datestoretxn_numberupcqtywgtrewa".

    Code:
     split datestoretxn_numberupcqtywgtrewa, parse(|)
    I am hoping to get some help on this. Thank you.
    Last edited by frederick lim; 20 Jul 2020, 16:46.

  • #2
    I wonder id you tried with a short name for the variable. just - rename - the variable and check it out. Please
    Best regards,

    Marcos

    Comment


    • #3
      great suggestion. Thanks!

      Comment


      • #4
        I get the same issue.
        Please see Error message: "Cannot generate new variables using stub" - Statalist
        This remains unresolved.

        Comment

        Working...
        X