Statalist The Stata Listserver


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

[no subject]



		type    meaning    length     offset
	---------------------------------------------
	var. 1    98    str98          98          0
        var. 2   136    str136        136         98
	var. 3   102    str102        102        234
	var. 4   105    str105        105        336
	var. 5   102    str102        102        441
	var. 6   98     str98          98        543
	---------------------------------------------
	sum                           641

The width of an observation (a.k.a. lrecl) is 641 bytes.  The approved 
method is to read the data an observation at a time, in 641 byte 
chunks.  

I will now use C jargon.  Let (unsigned char *) buf[] contain one observation.
You can then extract each variable using memcpy(), using the offsets and
lengths from the table above.  Once extracted, if numeric, and if bytes need
reordering, reorder them.  If string, add a binary 0 terminator in case one is
missing.

This should be easy to code, but you will have to build a table in your 
code to direct what needs to be done.

-- Bill
[email protected]
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index