Run procedure on all objects (series) in a group?

For questions regarding programming in the EViews programming language.

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

eliz.christy
Posts: 2
Joined: Fri Jul 24, 2009 10:02 am

Run procedure on all objects (series) in a group?

Postby eliz.christy » Fri Jul 24, 2009 11:03 am

I am a programmer, and am writing a program for a customer in eviews, although I have never used it before. I was able to write a program to run the Census x12 procedure on all of the series, but I have a line in the code for each series, and the series names are spelled out. This doesn't allow for changes in the series names. Is there a way to list the series in an array or to just run the procedure for all of the objects(series) in the group?

thanks

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

Re: Run procedure on all objects (series) in a group?

Postby EViews Gareth » Fri Jul 24, 2009 11:09 am

Use a for loop that runs from 1 to the number of objects in the group (group_name.@count). Then inside the loop use group_name.@seriesname to get the name of the current series.

Something like:

Code: Select all

for !i=1 to G.@count
    %name = G.@seriesname(!i)
    {%name}.x12
next
Follow us on Twitter @IHSEViews

eliz.christy
Posts: 2
Joined: Fri Jul 24, 2009 10:02 am

Re: Run procedure on all objects (series) in a group?

Postby eliz.christy » Fri Jul 24, 2009 12:56 pm

Thank you!!! :D

I was trying to read through the manual to figure it out and its so massive it was taking forever. I really appreciate it!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 20 guests