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

st: workaround for macro length problem with levelsof() ?

From   "Daniel Waxman" <>
To   <>
Subject   st: workaround for macro length problem with levelsof() ?
Date   Sat, 23 Feb 2008 16:56:57 -0500


I am trying to access a series of files using the values of a variable in
another dataset to as an index of the names of the files.  This is easy to
do with –levelsof-, except that the macro is truncated at a very small
number of characters (244?).

Here is what I’d like to do:

insheet using sp_components.csv
keep v1
levelsof(v1), local(namelist)

foreach name of local namelist {
	local filepath = "c:/mydata/"`name'"
	insheet using "`filepath'"

Since I need to clear memory each time, there is no easy workaround that I
can see using -forvalues-
I can't help but think that -levelsof- wouldn't bother to generate the nice
long list that it does if there weren't some way to use it.  Am I missing



Internal Virus Database is out-of-date.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.20.7/1283 - Release Date: 2/16/2008
2:16 PM

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index