Announcement

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

  • length of string characters

    Hi, I have a variable that is an open ended question and i wanted to know if there is any ability to increase the allowance to 300+ for a few wordy answers. I saw a post from Sergiy Radyakin from 2009 that says 244 is maximum but had hoped there have been new developments on this?

  • #2
    If you are using the current version of Stata (14), you should have no problem. Ordinary string variables can now go up to 2045 bytes (which may be somewhat less than 2045 characters if you have Unicode characters), and if that isn't enough, there are strL variables, which can contain up to 2,000,000,000 bytes. If you are thinking about a macro instead of a variable, then it depends on the flavor of Stata you are using: 51,800 for Small Stata, 264,392 for IC, and 4,227,143 for SE/MP. See -help limits-. I think open ended question responses will fit comfortably within these constraints.

    I'm not sure, but I think these same limits applied in a few earlier versions of Stata as well.

    Comment


    • #3
      Hi Clyde thank you very much for your response, unfortunately i have Stata v 12 IC. i used the following two commands to set the character limits but i can't go any further than 244.
      recast str244 varname
      format %244s varname

      Im afraid macros go a bit beyond my knowledge, I looked at the help limits info in stata and it says 244 is the longest alright, I didn't know about the limits option before you said it, it seems I will continue to see what the person wrote for this answer in excel file and do other analyses in Stata. Thank you

      Comment


      • #4
        At the risk of sounding like a huckster, there have been a lot new things added to Stata in versions 13 and 14. I personally have found them very useful, and if you are able to upgrade to version 14, I would recommend doing so. (I have no conflicts of interest to disclose in this connection.)

        Comment


        • #5
          You have a crude option of putting the overflow in a second str244. That doesn't really help you search across both variables.

          Other than that, your only real option is upgrading to version 14. (As with Clyde, StataCorp doesn't pay us to say that. But I think they like our doing it.)

          Comment


          • #6
            ​Thank you Clyde and Nick, maybe as a gratuity for your promotion of upgrading Stata, they may allow me to upgrade for free since you both already have it
            possibly putting a second string variable with the rest of the comment will be the quick and not so clean option, thanks Nick.

            Comment

            Working...
            X