in a project, we have to -outsheet- a Stata data set, and after some
intermediate steps on a mainframe computer, -insheet- the data again.
When doing some tests with -outsheet- and -insheet- it turns out that
after insheeting variables and comparing them to the original variables
using Stata's -compare-, values differ. Here is what I do:
***
/* data set contains variables var1 and id */
save using original.dta
outsheet using test.csv, comma
insheet using test.csv, clear
rename var1 var1_new
merge id using original
compare var1 var1_new;
---------- difference ----------
count minimum average maximum
--------------------------------------------------------------------
var1<var1_new 89433 -.0005035 -.000129 -7.45e-09
var1=var1_new 6097
var1>var1_new 89019 7.45e-09 .0001295 .0005035
----------
jointly defined 184549 -.0005035 -7.35e-08 .0005035
----------
total 184549
***
Admittedly, the differences are not large. Is there a way to make sure
values do NOT change AT ALL after outsheet - insheet?
One remark: the problem only seems to come up with floats and doubles
but not with integers.
Does -outsheet- work for integers (and bytes) only?