Date Format

For questions regarding programming in the EViews programming language.

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

GFXFTS
Posts: 39
Joined: Wed Nov 21, 2018 10:33 am

Date Format

Postby GFXFTS » Mon Jan 21, 2019 2:38 am

Hello,

I would like to write data from a workfile to a txt file with such a command for example:

write(t=txt,dates,nonames) C:\SENN\Models\Artificial\MLP\DATA\Data.txt YAR1LIN

When I open the .txt file the date format looks like this: "2/01/1970"

However, I would need such a format 1970-01-02 without the quotation marks.

Is that possible by chance?

Thanks a lot,

Guenter

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12908
Joined: Tue Sep 16, 2008 5:38 pm

Re: Date Format

Postby EViews Gareth » Mon Jan 21, 2019 8:34 am

Create an alpha series in your workfile with the date expressed however you want. Then save the workfile including that alpha series.
Follow us on Twitter @IHSEViews

GFXFTS
Posts: 39
Joined: Wed Nov 21, 2018 10:33 am

Re: Date Format

Postby GFXFTS » Mon Jan 21, 2019 8:46 am

Hi Gareth, That worked. It still saves it with the quotations marks though: "1970-01-05". Any chance to get rid of those as well? Thanks a lot, Guenter

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12908
Joined: Tue Sep 16, 2008 5:38 pm

Re: Date Format

Postby EViews Gareth » Mon Jan 21, 2019 10:13 am

Try using wfsave rather than write.
Follow us on Twitter @IHSEViews

GFXFTS
Posts: 39
Joined: Wed Nov 21, 2018 10:33 am

Re: Date Format

Postby GFXFTS » Mon Jan 21, 2019 12:32 pm

Hi Gareth, That worked but now I can't get rid of the first row :-( Best, Günter
dateid01 x y yar1lin yar1nonlin
1970-01-02 0 0 0 0
1970-01-05 0.11613408655140802 0.13072153426672658 0.13072153426672658

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12908
Joined: Tue Sep 16, 2008 5:38 pm

Re: Date Format

Postby EViews Gareth » Mon Jan 21, 2019 1:12 pm

There’s a nonames option.
Follow us on Twitter @IHSEViews

GFXFTS
Posts: 39
Joined: Wed Nov 21, 2018 10:33 am

Re: Date Format

Postby GFXFTS » Mon Jan 21, 2019 1:52 pm

Tried that one as well but didn't seem to work: wfsave(type=text,nonames) artificial_undated6.txt . I have attached the files. Thanks a lot, Günter
Attachments
artificial_data_d.wf1
(54.86 KiB) Downloaded 137 times
artificial6.txt
(76.86 KiB) Downloaded 142 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 12908
Joined: Tue Sep 16, 2008 5:38 pm

Re: Date Format

Postby EViews Gareth » Mon Jan 21, 2019 6:00 pm

Code: Select all

wfsave(type=text) artificial_undated6.txt nonames
Follow us on Twitter @IHSEViews

GFXFTS
Posts: 39
Joined: Wed Nov 21, 2018 10:33 am

Re: Date Format

Postby GFXFTS » Tue Jan 22, 2019 4:02 am

Brilliant. That worked. Thank you very much. Best, Günter

mmiller2
Posts: 16
Joined: Tue Aug 23, 2016 9:56 am

Re: Date Format

Postby mmiller2 » Tue Jun 22, 2021 4:50 am

Would you mind updating the documentation to specify that nonames must be supplied in the argument list to pagesave rather than as a parenthetical option? The other approach would be to fix pagesave to work as described in the documentation, but that would undoubtedly break a lot of EViews programs out there. Is it possible to make it so that nonames can be specified as BOTH a parenthetical option or an (undocumented) argument in the list - for backwards compatibility?

http://www.eviews.com/help/helpintro.ht ... esave.html


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 20 guests