@dateval does not convert alpha series to a date series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

mamo
Posts: 192
Joined: Wed Nov 07, 2012 9:11 am

@dateval does not convert alpha series to a date series

Postby mamo » Wed Mar 25, 2020 5:20 am

Dear Eviewers,

I use Eviews 11 Sept 2019 built 64 bit.

With the attached file and applying the code below, I want to generate a new series named "newdate" from the existing alpha-series named "date" with the values "Sat Feb 15 2020", "Sun Feb 16 2020", "Mon Feb 17 2020", ....

But I get only NAs.

Can you help me what the error is?

Best,
mamo

Code: Select all

series newdate=@dateval(date, "Wdy Mon DD yyyy")
Attachments
dates.wf1
(12.66 KiB) Downloaded 226 times

mamo
Posts: 192
Joined: Wed Nov 07, 2012 9:11 am

Re: @dateval does not convert alpha series to a date series

Postby mamo » Wed Mar 25, 2020 5:59 am

I solved the issue, and the solution suggests that there is a bug in the function @datevalue

First removing the three-letter weekday abbreviation at string positions 1-3 from the date string before applying @datevalue:

Code: Select all

series newdate=@dateval(@mid(date,5), "Mon DD yyyy")

yields the expected result.

It seems that the double day specification - the three-letter weekday abbreviation at the beginning and the two-digit-day-of-months at string positions 9-10 - confuses @datevalue.

Prbly sth to consider for future updates of EVIEWS.

Best, mamo

EViews Matt
EViews Developer
Posts: 564
Joined: Thu Apr 25, 2013 7:48 pm

Re: @dateval does not convert alpha series to a date series

Postby EViews Matt » Wed Mar 25, 2020 12:35 pm

Hello,

This is indeed a bug, and will be fixed in the next EViews patch.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests