Page 1 of 1

Simple Subrotines

Posted: Tue Oct 29, 2013 11:06 am
by amigosu
Hi,
I'm using this code to generate sazonally adjusted data:

Code: Select all

%variavel="comibgef0" smpl 2000 2013 '@all freeze(x12out) {%variavel}.x12(save="d11",tf=auto,sfile="G:\Macroeconomia\Dados Econômicos\Fontes Primárias\Dessazonalizacao\x12mensal_comercio.txt") delete x12out
The problem is that I have to run this program several times and each time change the name of the series (that is stocked at %variavel). Is there any way to make it easier?

I'm using eviews 7.2.

Re: Simple Subrotines

Posted: Tue Oct 29, 2013 11:21 am
by EViews Gareth
You could write a for loop that loops over the variables.

Re: Simple Subrotines

Posted: Thu Oct 31, 2013 10:13 am
by amigosu
The problem with a for loop is that the name of the series does not have any logical sequence. What I thought was to do something create a fuction with an argument that is the name of the series, so the code will still be easy to read. Other option is a switch or a combination of loop and ifs.

The problem is that I do not know anything about eviews programming syntax. Can you suggest anything?

Re: Simple Subrotines

Posted: Thu Oct 31, 2013 10:28 am
by EViews Gareth
You can use the @wlookup function to find out the names of all the series in the workfile, and then loop over them.

Or, you could put all the series you want to seasonally adjust into a group, and then loop over the members of the group.