Statalist The Stata Listserver

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

Re: st: How to prevent truncated string in macro expression

From   "Austin Nichols" <>
Subject   Re: st: How to prevent truncated string in macro expression
Date   Tue, 11 Jul 2006 15:17:27 -0400

. local temp4 : subinstr loc varlist " " ",", all
see -help extended_fcn- for details.

On 7/11/06, Grealy, Patrick J <> wrote:
I am having trouble with the limit for string lengths in expressions and
have not been able to find the solution. I'm sure I've seen it somewhere
and suspect it involves using the colon(:) instead of equals(=) method.
Here's the relevant section of code from my .ado file for a program
that, among other things, attempts to count the number of missings for
any of the input variables:

local temp4=subinstr("`varlist'"," ",",",.)
quietly count if missing(`temp4') & `touse'

I replace spaces in varlist with commas and save in a local macro and
use it as the argument for the missing function. This works fine until I
use too many variables and exceed the string limit. Can someone help me
with a method to get the macro to include the entire string?

Pat G.

*   For searches and help try:

*   For searches and help try:

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