Page 1 of 1

Problem with FOR statement

Posted: Tue Aug 31, 2021 4:57 am
by ricbeb
Hi! I'm using the FOR statement in my program, and got this error message:

For statement unterminated in "FOR !Z=1 TO 2"

Just to give some background, this is the relevant part of the code, where I'm defining two different samples to run the regressions:

sample muestra_est1 2001Q1 2020Q4
sample muestra_est2 2001Q1 2014Q4

for !z=1 to 2 [NOTE: THIS IS WHERE I GET THE ERROR MESSAGE AND THE PROGRAM STOPS]
smpl muestra_est{!z}

Any suggestions?

Many thanks for your time and kindness!

Ricardo

Re: Problem with FOR statement

Posted: Tue Aug 31, 2021 6:31 am
by startz
Do you have a matching

Code: Select all

NEXT
statement?

Re: Problem with FOR statement

Posted: Sun Sep 12, 2021 8:39 pm
by csullivanj
Hi all, i have a similar problem

I have two variables, a continuous variable, and ages.

I want to compute descriptive statistics for a variety of custom age ranges that are not currently programmed.

I am trying to use

[series a =@recode(AGE<44,1,na)]

And then repeat for the age ranges, then use this as a specification when computing "stats by classification" but it does not work. Can anyone assist here?

Re: Problem with FOR statement

Posted: Tue Sep 14, 2021 7:17 am
by EViews Matt
Hello,

I'm afraid we're going to need more information. The single code line you've shared would seem fine for creating a 1/na dummy series based on the contents of the AGES series. What other code isn't working?