Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: binary format type str question


From   Mark Fisher <mark@markfisher.net>
To   statalist@hsphsun2.harvard.edu
Subject   st: binary format type str question
Date   Mon, 12 Mar 2007 20:35:18 -0400

Hi. I'm writing a Mathematica program to read stata "dta" files. I have the "Stata help for dta" page, which is quite useful. Everything seems to work fine as long as the data types are in the range 251 to 255 (byte, int, long, float, or double). But I can't figure out how to properly read the data when the data types are in the range 1 to 244 (str1, str2, ... str244). BTW, I have no trouble reading the "char" strings for the data_label and the time_stamp; I just read them in as a list of bytes, discard the bytes starting with the first zero, and convert the remaining bytes to ascii. But the str types don't seem be the same sort of beast. Any guidance would be appreciated. Thanks.

--Mark.
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index