Sometimes we have to save our Stata databases using an old version. This has to be done, because some people still work with the long standing Stata 12 version. However, when we use the saveold command to do so, we sometimes face a problem with the long variable labels.

For this reason I developed an ado file called labtrunc12 that truncated all variable labels to an adequate length in order to save the database using the Stata 12 version. The syntax is very simple, you just have to type labtrunc12 and all database labels will be truncated. Instructions to use the command can be obtained typing help labtrunc12 into Stata.

Download labtrunc12 from my git repository: https://github.com/cauanebs/labtrunc12

Installing ado files in Stata

Perform the following steps to install ado files in Stata:

  1. Open Stata
  2. Type personal and hit enter to discover the location of your personal ado folder
  3. Navigate to the personal ado folder (if after navigating there is no folder called personal, create one)
  4. Unzip the downloaded file into the personal ado folder