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

Re: st: Forvalues, syntax error

From   "Gauri Khanna" <>
Subject   Re: st: Forvalues, syntax error
Date   Thu, 05 Jul 2007 14:13:58 +0000

Dear Neil,

Thank you for your prompt suggestion. I tried your suggestion and I seem to get an error at the beginning. I have only copied a couple of lines from the start to the point where the problem is identified.

Do you have any insight as to why the problem occurs? Thank you so much for your help.

set more off
set matsize 5000
set trace on
set tracedepth 2

use `allsvys1', clear
egen i=group(un_region2 sex_code) if excind!=1 & sex_code!=3 & total_age_group!=1 & agegrp==0
summarize i
local max1=r(max)
gen error1=.
gen error2=.
save `allsvys', replace

forvalues svy = 1/`max1' {
- forvalues svy = 1/`max1' {
= forvalues svy = 1/. {
invalid syntax



From: "Neil Shephard" <>
Subject: Re: st: Forvalues, syntax error
Date: Thu, 5 Jul 2007 14:48:15 +0100

Thats quite a bit of code for people to read through.

You could try "debugging" this by using the -set trace on- and setting
an appropriate -tracedepth- and then running your do-file.

Something like...

. set trace on
. set tracedepth 2
. do [your-do-file]

..will be more verbose, and should allow you to see which line is
causing your problem.  This would be a lot quicker than others trying
to read through the syntax.

If your not sure why the offending line is invalid post that
particular line as its interpreted to the list and someone might be
able to say what is wrong with the syntax.


"In mathematics you don't understand things. You just get used to
them."  - Johann von Neumann

Email - /
Website -
Photos -
*   For searches and help try:
Don't just search. Find. Check out the new MSN Search!

* For searches and help try:

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