Skip to main content


Showing posts from August, 2010

More on Working with Field-Tagged Data in Stata

I’ve been doing a lot with field tagged data recently (some of it is in html tables which I am still struggling with).

Below is the code for a (still messy and buggy) program called removetags.ado which is a working .ado file used to pull information from field tagged data from within Stata.

The biggest challenges for me have been (1) how to adapt the code when some fields span multiple rows without field tags to identify them and (2) how to deal with long entries in Stata (since there is a 244 string limit).

I think I’ve solved (1) for most cases (see lines 71-90 in the ado-file linked below), but it’s clunky and I’m sure I’ll need to adapt it further when I run across things that make it choke. However, I am currently working on solving (2).

[[So far, my solution involves identifying the rows that are longer than 244 chars using -file read-, and then reading those rows into Stata as characteristics associated with each record. The advantage of this approach is that you can still ma…