When I type a fetch command into the command window, I get prompted with a dialogue about whether I want to overwrite or merge the data. But if I have a fetch command in a program, it seems that the default is to overwrite, and I cannot find any options for the fetch command that would let me set it to merge data rather than overwriting.
Is there a way to do this? Or is my only option to fetch the data into a blank page and then use copy, for which I can set a merge option, to move it into the page where I actually want it?
how to turn on "merge" with fetch command
Moderators: EViews Gareth, EViews Moderator
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to turn on "merge" with fetch command
Undocumented "m" option on fetch.
Couple of other points
Couple of other points
- You can actually use the copy command to copy from certain databases direct to a workfile
- If you do the fetch interactively, the command capture window will show you the command line form (including the m option).
Re: how to turn on "merge" with fetch command
That is easy! Thanks. I think this was my first time not just typing a fetch command.
Re: how to turn on "merge" with fetch command
Further on "merging", which is not behaving how I expect. How can I fetch data that exists in a database ranging from, say, 1980-2020, if I only want to update the data in my workfile ranging from 1980-2020 through 2015? (So workfile smpl = 2016 2020.) I really don't want to create a workpage ranging from 1980-2015 and then copy the data to my main workpage; I need to do this task frequently and on an ad hoc basis, so that copying is way too inconvenient.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to turn on "merge" with fetch command
Could you be more explicit on what you're trying to do?
Which dates are you fetching from, and which dates are you fetching to? Where are there NAs?
Which dates are you fetching from, and which dates are you fetching to? Where are there NAs?
Re: how to turn on "merge" with fetch command
I have a quarterly workfile with range 1994 2028. I have a series that runs from 2010 to 2028. I want to fetch that series from a database ONLY from 2026 to 2028.
Setting sample 2026 2028 and using fetch, including fetch(m), does not work. There are not any NAs in the specified period - I want to compare basically two different versions of a forecast. I know a consistent method to achieve the task, which is creating a new page dated 2026 2028, fetching the series to that page, and then copying from the 2026 2028 page. But that is a LOT of gymnastics for what is often an ad hoc task.
It would also be really nice to be able to specify the target series' name in the workfile in the fetch command. For example, maybe I want to compare the current version of a series to a previous version. I should be able to type, in one line, something like: fetch( ) seriesA as seriesA_old. Since seriesA exists in the workfile already and I do not want it overwritten, the only way to achieve this that I can figure out is to again do gymnastics through an additional page. (Even better would be if I could optionally specify seriesA_old as a temporary variable that would not be saved in the workfile to keep clutter minimal. I have previously used packages that used "#" as an object prefix that automatically made an object temporary in this way.)
Setting sample 2026 2028 and using fetch, including fetch(m), does not work. There are not any NAs in the specified period - I want to compare basically two different versions of a forecast. I know a consistent method to achieve the task, which is creating a new page dated 2026 2028, fetching the series to that page, and then copying from the 2026 2028 page. But that is a LOT of gymnastics for what is often an ad hoc task.
It would also be really nice to be able to specify the target series' name in the workfile in the fetch command. For example, maybe I want to compare the current version of a series to a previous version. I should be able to type, in one line, something like: fetch( ) seriesA as seriesA_old. Since seriesA exists in the workfile already and I do not want it overwritten, the only way to achieve this that I can figure out is to again do gymnastics through an additional page. (Even better would be if I could optionally specify seriesA_old as a temporary variable that would not be saved in the workfile to keep clutter minimal. I have previously used packages that used "#" as an object prefix that automatically made an object temporary in this way.)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13585
- Joined: Tue Sep 16, 2008 5:38 pm
Re: how to turn on "merge" with fetch command
Agreed on the overall suggestion. I think a cleaner workaround is to temporary rename the existing series, fetch, compare, then delete and rename back, rather than using a new page.
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 2 guests
