@wfindnc help

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

jbourque
Posts: 7
Joined: Tue Jul 05, 2011 8:26 am
Location: Ottawa, Ontario (Canada)
Contact:

@wfindnc help

Postby jbourque » Thu Jul 26, 2012 1:42 pm

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

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: @wfindnc help

Postby EViews Esther » Thu Jul 26, 2012 2:50 pm

Code: Select all

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

jbourque
Posts: 7
Joined: Tue Jul 05, 2011 8:26 am
Location: Ottawa, Ontario (Canada)
Contact:

Re: @wfindnc help

Postby jbourque » Fri Jul 27, 2012 6:17 am

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
Attachments
sodc.txt
list of series in millions
(590 Bytes) Downloaded 425 times
sodc.wf1
Sample of series downloaded from Haver. Description shows that series are either in Mil or Bil of the country's currency
(49.11 KiB) Downloaded 340 times

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: @wfindnc help

Postby EViews Esther » Fri Jul 27, 2012 8:19 am

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")


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests