Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Bizzare return code in Mata


From   "Thomas, Anthony" <[email protected]>
To   [email protected]
Subject   st: Bizzare return code in Mata
Date   Mon, 17 Mar 2014 08:48:17 -0400

Hi All,

I need Stata to always import certain columns of a set of CSV files as
string. Insheet (Stata 11 - Unix) does not provide any options for
coercing variables to string so I wrote a small Mata utility which
appends some non-numeric characters to the first observation in a
specified column, copies the observation to the end of the file,
insheets the data (which will now be read as string) and then
truncates the file before the new line to restore the file to its
original status.

In one CSV (the program works fine for all others), the call fseek(fh,
0, 1) to seek the end of the file, aborts with the error r(1458296728)
- Stata returned error. I strongly suspect this is not a valid return
code... Also I'm a bit confused as to why Stata needs to be involved
at all. I assumed Stata called Mata's file routines, not the other way
around. Stata will happily insheet the file, and a hexdump of its
contents reveals no irregularities. Does anyone have any suggestions
as to what to look for or why I am getting this strange return code?

Thanks,

Anthony
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index