Page 1 of 1

renaming series ... adding an increasing suffix

Posted: Sat Nov 07, 2020 6:54 am
by dsdsdsdsd
hello ...

I have series: yr05 , yr06 , ...

I want: yr1980 , yr1981 , ...

I have tried variations of:

Code: Select all

rename yr* @left( "yr" + @str( @val(*) + 1975) , 999 )
I am using @left simply because it returns ...

thanks

Re: renaming series ... adding an increasing suffix

Posted: Mon Nov 09, 2020 11:00 am
by EViews Matt
Hello,

Unfortunately, the rename command does not accept functional transforms, only patterns. However, you can easily achieve your goals with a loop.

Code: Select all

%series = @wlookup("yr*", "series") for %s {%series} %new_name = "yr" + @str(@val(@mid(%s, 3)) + 1975) rename {%s} {%new_name} next