Page 1 of 1

Referencing objects in workfile EV6

Posted: Thu Jun 10, 2010 2:18 am
by Tomski
Hi,

Is it possible to reference objects in a workfile without knowing their name. So for example, say I open foreign data as a workfile, I then have a workfile that contains a number of series, can I apply the dlog operator to each series? I imagine it would be something along the lines of:

series dl1 = dlog(series_in_wf_array(1))

series dl2 = dlog(series_in_wf_array(2))

etc...

Or set a string variable to the first series name, so somnething like

%series1 = series_in_wf_array(1).name

Thanks,

Tom

Referencing objects in workfile EV6

Posted: Thu Jun 10, 2010 6:57 am
by EViews Gareth
You can use the @wlookup function to obtain the names of the objects in the workfile.

Re: Referencing objects in workfile EV6

Posted: Thu Jun 10, 2010 8:07 am
by Tomski
Thanks, but I'm using eviews 6 which doesn't seem to have that method.

I'm basically trying to loop through a number series and create new dlog series for each one. Struggling a little with the syntax.

T

Re: Referencing objects in workfile EV6

Posted: Thu Jun 10, 2010 8:18 am
by EViews Gareth
Sorry, didn't notice you were using EV6 (my fault!).

If you're only interested in series, you can create a group with all series in the workfile, then loop through the members of the loop one at a time:

Code: Select all

group g * for !i=1 to g.@count %sn = g.@seriesname(!i) 'do something here next

Re: Referencing objects in workfile EV6

Posted: Thu Jun 10, 2010 11:14 pm
by Tomski
Great, thanks

T