Date format using wfsave

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

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

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Date format using wfsave

Postby vivienle » Wed Jan 23, 2013 7:59 am

Hello,
I am using the following command line to export monthly series that end in _hp to Excel using wfsave.
wfsave(2,t=excel,maptype=n) "W:\EViews\test_write_potential.xls" @keep *_hp
The dates exported are in the format of YYYY/MM/DD showing the first date of each month. I actually want the dates to be the last date of the month in DD/MM/YYYY. Is it possible to do that using wfsave? I know "write" has the option to convert dates to the last date but I need to use wfsave. Also, I don't want to use @datestr to get to the DD/MM/YYYY format as the dates would be exported as text instead of date value.
Thanks,
viv

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: Date format using wfsave

Postby EViews Chris » Wed Jan 23, 2013 9:48 am

The following command

wfsave(2,t=excel,maptype=n) "W:\EViews\test_write_potential.xls" @keep @enddate *_hp

will add an extra column containing the end of period dates (where @enddate will be an excel date number, not a string).

I'm afraid we always set the cell format to YYYY-MM-DD at the moment.

Chris

vivienle
Posts: 14
Joined: Mon Jun 11, 2012 6:30 am

Re: Date format using wfsave

Postby vivienle » Wed Jan 23, 2013 10:19 am

Hi Chris,
Thanks for your quick response!!!
So I added @enddate and I did get an extra column with the end dates. For some reason, Excel seems to have problem reading the dates. For example, the value is "01/31/1950 12:00:00 AM" but it's displayed as "02/01/1950 12:00:00 AM" in Excel and read as 02/01/1950 if you use the date to do calculations. Would you know why and how to fix it?
Thanks again,
viv


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 5 guests