Page 1 of 1

@wfindnc help

Posted: Thu Jul 26, 2012 1:42 pm
by jbourque
Hi,
I'm d
owloading a large number of data series from Haver in E-views, some of which are in million, some are in billions. This is indicated in the series description (for example: "Anguilla: Stock of Domestic Credit (Mil.XCD)". In my program, I need everything to be in billions to calculate a ratio.

I was trying to find a way to seach the description string and return a positive number if it contains "Mil" or "mil", 0 if it does not. I tried a combination of the @wfindnc and @description commands to do that, but it doesn't seem to be working (I always get 0, even on series I know are in millions).

%temp = seriesname.@description
!million = @wfindnc(%temp,"mil")

Any help on how to make this work?
Thanks,
Jerome

Re: @wfindnc help

Posted: Thu Jul 26, 2012 2:50 pm
by EViews Esther

Code: Select all

%temp = seriesname.@description !million = @wfindnc(%temp,"mil")>0 'will return 1 if the string contains "mil", 0 otherwise.

Re: @wfindnc help

Posted: Fri Jul 27, 2012 6:17 am
by jbourque
Thanks, but it doesn't appear to be working on the series I'm applying them too. The code always returns 0 no matter the value I put in between quotation marks ("mil", "Mil", "MIL").

I'm attaching the workfile containing a sample of the series I have, and the list of series where the description says the magnitude is in millions. Any help is greatly appreciated.

Thanks again.
Jérôme

Re: @wfindnc help

Posted: Fri Jul 27, 2012 8:19 am
by EViews Esther
The problem is that the term "Bil" cannot be separable from the string "(EOP, Bil.Pounds)". For instance, when you do

Code: Select all

!million = @wfindnc(a112sodc,"(EOP, Bill.Pounds)")>0
you will get !million=1.

Why don't you try this one instead?

Code: Select all

%temp = seriesname.@description !million=@instr(%temp,"Mil")