saving .dta on Mac

saving .dta on Mac

by Rachel -
Number of replies: 6

After cleaning up my data in my do file and adding the save “xxx.dta”, replace line a .dta file is created in my folder however I receive the following error message when I try to open the .dta file. 

"The document is not encoded in UTF-8!

Stata will open the document with Stata 13's default character encoding but will save the file using UTF-8 character encoding."

Is there anything I can do to correct this error message?

Thanks

 

In reply to Rachel

Re: saving .dta on Mac

by Wayne Enanoria -

I am not sure I understand the problem. Two questions:

(1) What version of Stata are you using to analyze your data?

(2) What version of Stata was used to create your data file?

If you are using Stata 14, Stata 14 uses UTF-8, a form of Unicode to encode strings. Previous releases of Stata used ASCII. Datasets, do-files, ado-files, and help files may need translation to display properly in Stata 14. See the "unicode translate" command for more details (http://www.stata.com/manuals14/dunicodetranslate.pdf). However, files containing strings using only plain ASCII do not need translation. I am trying to find out the nature of your problem before I can respond and help troubleshoot.

In reply to Wayne Enanoria

Re: saving .dta on Mac

by Rachel -

 I'm using Stata 14 to create and analyze my data. 

In reply to Rachel

Re: saving .dta on Mac

by Megha Mehrotra -

I'm not totally sure why you're getting that error given that you're creating the file in STATA 14, but the "unicode translate" command should work.

 

The help file is here: http://www.stata.com/manuals14/dunicodetranslate.pdf

and the relevant command you'll need is: 

unicode translate filename

Open STATA without opening any dataset and run that command. 

Where filename is the name of the dataset you're having issues with. STATA will create a backup of this dataset that is left in its original format, so don't worry about losing anything. Let me know if this doesn't work for some reason.

Megha

In reply to Megha Mehrotra

Re: saving .dta on Mac

by Rachel -

I get an error message when I enter this command that states the following:

 

"encoding not set
Before using unicode translate, you must set the character encoding you believe is being
used, such as latin1. There are lots of encodings. You set the encoding using the unicode
encoding set command. You can set and reset the encoding and repeat the unicode translate
command to see which works best."

In reply to Rachel

Re: saving .dta on Mac

by Bliss Temple -

How was your dataset created initially?

In reply to Bliss Temple

Re: saving .dta on Mac

by Rachel -

Originally in access, I exported it to an excel.csv file that I then imported into stata as a delimited text file.