(For reference, deseas(list,T) would equal

list mylist = dataset

loop foreach i mylist
 string s1=""
 sscanf "sa_$i","%13s",s1 
 series @s1 = deseas($i,T)
end loop

if I'm not mistaken this time around)

2009/11/18 Patricio Cuarón <patriciocuaron@gmail.com>
Yes, it did. But it raised a few more questions...
Would it have been the same to use @i instead of $i?
If there a way to tell the script not to stop on errors (~VBA on error resume next)?
And why doesn't deseas() work with lists as arguments?


On Wed, Nov 18, 2009 at 3:17 PM, Sven Schreiber <svetosch@gmx.net> wrote:
Hi Patricio,

list mylist = dataset
loop foreach i mylist
 series sa_$i = deseas($i)
end loop

should work for your first question.

If I understand correctly, it may even solve the second one?


-------- Original-Nachricht --------
> Datum: Wed, 18 Nov 2009 14:54:25 -0200
> Von: "Patricio Cuarón" <patriciocuaron@gmail.com>
> An: gretl-users@lists.wfu.edu
> Betreff: [Gretl-users] operate on all variables

> Hello. I'm new to gretl and I'm trying to create a simple script that
> will,
> for instance, seasonally adjust all variables. And I've run into troubles.
> So...
> 1. how do I generate variable *variable names* to genr? for instance, I
> want
> to call each detrended variable "sa_" & the original variable name
> 2. how do I pass the parameter to deseas()? deseas(gdp) works fine, but
> deseas(varname(4)) doesn't (assuming varname(4)="gdp", varname returns a
> string and deseas doesn't work that way. I also tried looping through a
> list
> of all the variables, but the same error of erroneous argument type is
> brought up by deseas().
> Thanks!!
> PC

Gretl-users mailing list