Page 1 of 1

Reading of date format

Posted: Thu Sep 30, 2010 9:13 am
by javiersan
This is a similar question to that of http://forums.eviews.com/viewtopic.php?f=5&t=3085

I have a file with a numeric series contaning the following:
series03: a series with dates in the format yyyyqq and yyyy
series02: an alpha with either Q or FY

I use the following command to read the quarterly part:
wfopen jpn_fof.csv @selectif series02="Q"

but Eviews interpretes it as of monthly frequency such as 1997m01, m02, m03, m04, 1998m01, m02, m03...

I have tried to open the file and create a new series from where I could restructure the file:
wfopen jpn_fof.csv @selectif series02="Q" @genr mydates=@series(@str(series03),4)+"q"+@right(@str(series03),2)

but this doesn't work as @genr appears to accept only "series", not "alphas".

Can you please suggest a solution?

Many thanks,

Javier

Re: Reading of date format

Posted: Thu Sep 30, 2010 12:04 pm
by EViews Chris
It's not clear what you mean by "yyyyqq" since quarter only contains 1 digit, so "qq" doesn't make much sense in EViews. (It actually means to repeat the quarter number twice, which I doubt is what you had in mind).

If you mean that you always want an extra leading zero before the quarter number, EViews would call that format "YYYY[0]Q".

So if your data looks like this:

Code: Select all

series02 series03 x Q 200001 1 Q 200002 2 Q 200003 3 Q 200004 4 FY 2000 5 Q 200101 6 Q 200102 7 Q 200103 8 Q 200104 9 FY 2001 10
you should be able to read this by manually specifying the date format as follows:

Code: Select all

wfopen myfile.csv @selectif series02="Q" @id @date(@dateval(@str(series03), "YYYY[0]Q"))
where I'm using @str to convert series03 to a string and then using the explicit format in dateval to skip past the zero.

There would be a variety of other similar approaches.

Re: Reading of date format

Posted: Thu Sep 30, 2010 12:20 pm
by javiersan
That's what it was, many thanks.

Javier

Re: Reading of date format

Posted: Thu Sep 30, 2010 12:42 pm
by EViews Chris
BTW, I think you were on the right track. @genr does allow a string series, so the following works for me too:

Code: Select all

wfopen myfile.csv @selectif series02="Q" @genr mydates=@left(@str(series03),4)+"q"+@right(@str(series03),2)
I think you just had a minor typo (@series instead of @left?) which was causing an error that was hard to interpret.

Re: Reading of date format

Posted: Thu Sep 30, 2010 3:53 pm
by javiersan
You are absolutely right, that was a typo that I missed. Thanks for pointing it out.