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
Reading of date format
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Chris
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Reading of date format
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:
you should be able to read this by manually specifying the date format as follows:
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.
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 10Code: Select all
wfopen myfile.csv @selectif series02="Q" @id @date(@dateval(@str(series03), "YYYY[0]Q"))There would be a variety of other similar approaches.
Re: Reading of date format
That's what it was, many thanks.
Javier
Javier
-
EViews Chris
- EViews Developer
- Posts: 161
- Joined: Wed Sep 17, 2008 10:39 am
Re: Reading of date format
BTW, I think you were on the right track. @genr does allow a string series, so the following works for me too:
I think you just had a minor typo (@series instead of @left?) which was causing an error that was hard to interpret.
Code: Select all
wfopen myfile.csv @selectif series02="Q" @genr mydates=@left(@str(series03),4)+"q"+@right(@str(series03),2)Re: Reading of date format
You are absolutely right, that was a typo that I missed. Thanks for pointing it out.
Who is online
Users browsing this forum: No registered users and 2 guests
