Page 1 of 1

@replace question

Posted: Thu Oct 18, 2018 7:31 am
by BT454
Hi all,
I have a long list of series in a work file. The series names are set up as a merger of concept and geography i.e. priceus, pricecan.
I'd like to create a string of all the series, and remove the common concept characters from each name in the string. I'm attempting to use the @replace command, but I'm not having any luck. In this instance the code I'm using is:

group g_all cat* '(all series that start with "cat")
%vars = g_all.@members 'create string of all series starting with cat
%vars = @replace(%vars,"cat","") 'replace characters "cat" with nothing
show %vars 'display contents of string to check that characters have been removed

However, the code is not working, and cat is not removed from any of the series when the string is displayed.
Any insight or help is appreciated.
Thanks!
Bob

Re: @replace question

Posted: Thu Oct 18, 2018 9:25 am
by EViews Matt
Hello,

The series names are being returned to you in uppercase, and @replace is case sensitive. Simply change your search string from "cat" to "CAT".

Re: @replace question

Posted: Thu Oct 18, 2018 10:54 am
by BT454
That worked. Thanks!