Yes.
local type : type <varname>
For your purposes, you might want to go straight
to -ds-.
. ds, has(type 10/244)
names all such variables, after which you can loop
. foreach v in `r(varlist)' {
...
To do this, you need Stata 8 updated after 17 June 2003.
Nick
[email protected]
PAUL HEWETT
>
> I am looking to loop through each of the variables in my
> dataset and manipulate variables that are of data type str10
> or more. Is there any way I can capture the data type of a
> variable? Neither describe or codebook seem to have return
> codes r( ) that would serve this purpose. If I can capture
> the variable type as a string, e.g., "byte", "str5",
> "integer" it would easy from there.
*
* 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/