a program executing other program in a loop (EV 6)

For questions regarding programming in the EViews programming language.

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

Krzysztof
Posts: 15
Joined: Mon Jan 11, 2010 3:53 am

a program executing other program in a loop (EV 6)

Postby Krzysztof » Mon Jul 26, 2010 1:09 am

Hi,
I would like to ask the following question.
Would it be possible to write a program which would run other program in a loop with different arguments depending on a step of the loop. I have one prg with a parameter and I can execute it from a command line for instance: run program_1 austria, run program_1 belgium, etc. where argument in this case is a country name.
Many thanks in advance.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: a program executing other program in a loop (EV 6)

Postby EViews Glenn » Mon Jul 26, 2010 10:11 am

In EViews 6, a running program file ends all program execution upon return. So you cannot run a program from within a program and return control to the calling program upon completion. You can use include statements to get the same effect, as described in the manual.

One of the major advances in EViews 7 is to allow the return of control to the original program.

Krzysztof
Posts: 15
Joined: Mon Jan 11, 2010 3:53 am

Re: a program executing other program in a loop (EV 6)

Postby Krzysztof » Wed Aug 04, 2010 2:31 am

Hi,
luckily I can use Eviews 7 now.
Would you tell me how to overcome this problem in Eviews 7?
To be more precise I would like to execute the piece of program below. However, the execution stops after first step so I guess I need some command to return control to the calling program.
Many thanks is advance.

Code: Select all

for %aCtry country1 country2 country3 country4 run my_program {%aCtry} next

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

Re: a program executing other program in a loop (EV 6)

Postby EViews Gareth » Wed Aug 04, 2010 8:09 am

Use the EXEC command rather than the RUN command.

The main difference between the two is that the EXEC returns to the calling program upon exit, whereas RUN stops.

Krzysztof
Posts: 15
Joined: Mon Jan 11, 2010 3:53 am

Re: a program executing other program in a loop (EV 6)

Postby Krzysztof » Thu Aug 05, 2010 2:08 am

Thanks but are you sure about that (see the attachment)? I was not able to find this command in the Eviews manuals either.
Attachments
untitled.JPG
untitled.JPG (8.26 KiB) Viewed 6607 times

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

Re: a program executing other program in a loop (EV 6)

Postby EViews Gareth » Thu Aug 05, 2010 6:30 am

You need to make sure you're using EViews 7.1


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest