I have two issues I am trying to solve.
First, I need an ad hoc (ie via the command window, not through a program) way to COPY a string.
Fetching a string is straightforward:
fetch(d=database,t=f,server=server) {string}
I expect copying a string from quarterly data to annual to also be straightforward, but the below is not working:
copy(link, c=average, propnas) q\{string} a\{string}
I know how to carry this out in a program, but I am having trouble figuring out the syntax for command mode. I do not want to have to create a new program every time I loop through a string.
Second, I can't figure out why my FETCH command is fetching the entire range of the workfile instead of just the sample of the workfile.
Workfile range is 2000 to 2021q4.
Here are my commands:
smpl 2019 2019q2
fetch(d=database,t=f,server=server) seriesname
But this FETCH is retrieving the entire range of 2000 to 2021q4! It must be possible to fetch only historical data or only a certain subset of the workfile, and I thought that SMPL was how I set the dates that my command would apply to, as I do not see any range options in the FETCH command itself.
fetching from db for sample and copying a string
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: fetching from db for sample and copying a string
For the first one, I'm going to assume you want to copy the contents of the string, not the string itself. In which case the code you provided will work just fine.
Fetch always fetches to the entire workfile range.
Fetch always fetches to the entire workfile range.
Re: fetching from db for sample and copying a string
For #1, here is exactly what I am typing:
copy(link, c=average, propnas) q\{stringnewmac} a\{stringnewmac}
stringnewmac exists on both the q and a pages, and all the data of stringnewmac exists in q but not a.
If I start on page Q, my error is:
"Extra argument in Copy command. Match merge is only available when copying between workfile
pages."
If I enter this line when on page A, my error is:
"Undefined contraction method in Link specification", and I get the same error if I take out the "propnas" option.
For #2,
So what is the recommended way to update data for only a subset of the workfile range? Manually editing these series is not really an option given the quantity of data and potential for entry error. I guess I could pull from my database into Excel and then copy and paste my update into Eviews, but this prevents me from having a nice clean update program to run and is quite a lot of extra steps.
Is this range issue going to be a problem for other tasks I plan to carry out, such as solving a model for only the forecast part of the workfile range such that historical data in the workfile will not be overwritten but future data will be calculated as in the model?
copy(link, c=average, propnas) q\{stringnewmac} a\{stringnewmac}
stringnewmac exists on both the q and a pages, and all the data of stringnewmac exists in q but not a.
If I start on page Q, my error is:
"Extra argument in Copy command. Match merge is only available when copying between workfile
pages."
If I enter this line when on page A, my error is:
"Undefined contraction method in Link specification", and I get the same error if I take out the "propnas" option.
For #2,
So what is the recommended way to update data for only a subset of the workfile range? Manually editing these series is not really an option given the quantity of data and potential for entry error. I guess I could pull from my database into Excel and then copy and paste my update into Eviews, but this prevents me from having a nice clean update program to run and is quite a lot of extra steps.
Is this range issue going to be a problem for other tasks I plan to carry out, such as solving a model for only the forecast part of the workfile range such that historical data in the workfile will not be overwritten but future data will be calculated as in the model?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: fetching from db for sample and copying a string
You can have multiple objects listed in the copy command.
Fetch into the entire workfile range, then assign into a new series only the values you want.
Fetch into the entire workfile range, then assign into a new series only the values you want.
Re: fetching from db for sample and copying a string
Sorry, Gareth, I did not understand your last response.
Did you mean I CAN'T have multiple items in the copy command? Otherwise, I don't see why the line of code that you said earlier would work is not working. I am hoping that Eviews will interpret the strings as a command to loop through that command using the string, just like happens when you use a {string} in something like a FETCH or STORE command.
copy(link, c=average, propnas) q\{stringnewmac} a\{stringnewmac}
Can you also be much more explicit about how to fetch history into a workfile? I am not following your suggestion at all. Let's say I have a quarterly workfile with range 2000 to 2021. I want to update existing series named in "stringnewmac" through 2019q2 from a database, without overwriting forecast. What do I type?
Did you mean I CAN'T have multiple items in the copy command? Otherwise, I don't see why the line of code that you said earlier would work is not working. I am hoping that Eviews will interpret the strings as a command to loop through that command using the string, just like happens when you use a {string} in something like a FETCH or STORE command.
copy(link, c=average, propnas) q\{stringnewmac} a\{stringnewmac}
Can you also be much more explicit about how to fetch history into a workfile? I am not following your suggestion at all. Let's say I have a quarterly workfile with range 2000 to 2021. I want to update existing series named in "stringnewmac" through 2019q2 from a database, without overwriting forecast. What do I type?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: fetching from db for sample and copying a string
Sorry, yes, I meant cannot
Code: Select all
fetch(p=temp) stringnewmac
smpl @first 2019q2
stringnewmac = tempstringnewmac
Re: fetching from db for sample and copying a string
Well, now there is a new problem. Apparently I needed to mention that I am using a FAME database.
When I use the p=___ option in fetch, I get the following error:
Database Error: FAME library error: 'Password specified without
username'.
Does anyone else have tips on how to do this workflow? Surely updating historical data from a database is a common process. Even if I do get this fetch command working, I still have to delete the temporary variables. I am very surprised there is not a simple, one-step procedure.
When I use the p=___ option in fetch, I get the following error:
Database Error: FAME library error: 'Password specified without
username'.
Does anyone else have tips on how to do this workflow? Surely updating historical data from a database is a common process. Even if I do get this fetch command working, I still have to delete the temporary variables. I am very surprised there is not a simple, one-step procedure.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: fetching from db for sample and copying a string
It is quite rare to want to mix fetched data with local data in-place.
Most people prefer to keep things separate.
Most people prefer to keep things separate.
Who is online
Users browsing this forum: No registered users and 2 guests
