Running an prg file in a loop

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

jxwong
Posts: 6
Joined: Mon Nov 14, 2016 3:12 am

Running an prg file in a loop

Postby jxwong » Mon Feb 20, 2017 2:57 am

Hi,

My loop stops after the first iteration when i run a prg file in the loop.

Could someone let me know what is wrong with the loop code? A simplified code of my loop is as follows:

for %x abc def ghi
series y = y_{%x}
series x = x_{%x}

run regression.prg

next

----------------------

The regression.prg can run with no problems.

Thanks and regards
Jian Xiang

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Running an prg file in a loop

Postby EViews Gareth » Mon Feb 20, 2017 7:18 am

Use exec rather than run.

jxwong
Posts: 6
Joined: Mon Nov 14, 2016 3:12 am

Re: Running an prg file in a loop

Postby jxwong » Mon Feb 20, 2017 4:58 pm

Thanks Gareth. Is it possible to make the execute function continue despite infinite errors?

Understand that exec(10) would mean the program would stop only after 10 errors are detected. What do i put inside the () to tell eviews to not stop despite errors.

Regards,
Jian Xiang

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Running an prg file in a loop

Postby EViews Gareth » Mon Feb 20, 2017 6:17 pm

exec(10000000) :D


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest