Statalist The Stata Listserver


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

st: long macro


From   "Dedman, Dan" <[email protected]>
To   <[email protected]>
Subject   st: long macro
Date   Wed, 22 Feb 2006 15:11:20 -0000

Dear All

I was trying to create a macro that contained a long list of (icd10) codes that are stored in a temporary dataset. There are 290 obs and icdcode is str4 variable, so I reasoned that thereshould not be any problem storing this many characters in a macro. Intercooled stata has a limit of around 68000 characters in a macro, so I was surprised to find that the that the code works fine until "`codelist'" reaches 244 characters in length. After that it fails to grow in subsequent iterations.

My code looks like this:
<snip>
version 9
local i=1
local codelist
while `i'<= _N {
 	local codelist = "`codelist'" + " " + icd10code[`i']
 	local ++i
 	}
<snip>

What am I doing wrong?

Many thanks

Dan Dedman
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Daniel Dedman
Public Health Information Specialist/Analyst
North West Public Health Observatory
Centre for Public Health
Castle House
North street
Liverpool L3 2AY

t: 0151 231 4508
m: 07812 192578
f: 0151 231 4515
e: [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