Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Sergiy Radyakin <serjradyakin@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: syntax error |
Date | Tue, 22 Oct 2013 19:21:56 -0400 |
David, Nick has answered it already, but I will just rephrase the manual, gettoken allows at most two names before the column, but you have specified 3. The square brackets in the syntax diagrams mean that the content is optional, but this should not be interpreted as the content can be stretched to become an array. Best, Sergiy On Tue, Oct 22, 2013 at 7:03 PM, David Rivenbark <econman200@earthlink.net> wrote: > I have written a simple rclass program that has the following > structure. > > Program MYprog, rclass > > syntax varlist [if] [in] [, opt1(real 0) opt2(real 0) . ] > > gettoken y x1 x2 : varlist > > tempvar q > > gen double `q' = f(`y',`x1',`x2') > sum `q' > return scalar mean=r(mean) > > end > > > When I run the program with "MYprog y x1 x2" I receive an "invalid syntax" > error message Stata reaches -gettoken-. Can someone help me understand my > error using -gettoken-? > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/