com automation and makeresid

For questions regarding programming in the EViews programming language.

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

Ravi
Posts: 11
Joined: Fri Apr 29, 2011 6:22 am

com automation and makeresid

Postby Ravi » Mon May 30, 2011 2:16 am

when I execute makeresid via a vb script by executing

Code: Select all

command = equation & ".makeresid temp_resid" app.Run(command) command = "freeze(mode=overwrite,temp_resid2) temp_resid" app.Run(command) command = "temp_resid2.save " & output & "\\ACT_FIT_RES\\" & equation & ".makeresid" app.Run(command)
I get the following result

Last updated: 05/30/11 - 14:31 Last updated: 05/30/11 - 14:31 Last updated: 05/30/11 - 14:31 Last updated: 05/30/11 - 14:31 Last updated: 05/30/11 - 14:31

XYZ - 12/04/04 NA NA NA NA NA
XYZ - 1/08/05 NA 0.327887 -0.331114 -0.225509 -0.00157
XYZ - 2/12/05 0.324257 -0.118165 -0.139507 -0.280549 0.064118
however when I do it through the graphic user interface of Eviews I get the following output
XYZ - 12/04/04 NA
XYZ - 12/11/04 NA
XYZ - 12/18/04 NA
XYZ - 12/25/04 NA
XYZ - 1/01/05 NA
XYZ - 1/08/05 NA
XYZ - 1/15/05 0.327887
XYZ - 1/22/05 -0.331114
XYZ - 1/29/05 -0.225509
XYZ - 2/05/05 -0.001570
XYZ - 2/12/05 0.324257
XYZ - 2/19/05 -0.118165
XYZ - 2/26/05 -0.139507
XYZ - 3/05/05 -0.280549
Why is this happening?
What changes do i need to do to the vb script to get the output as i am getting in GUI?

Thanks in advance.
-Ravi

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

com automation and makeresid

Postby EViews Gareth » Mon May 30, 2011 6:08 am

First thing to do is to ensure your copy of EViews is fully up to date. We had a recent bug that might make makeresid screwy.

Ravi
Posts: 11
Joined: Fri Apr 29, 2011 6:22 am

Re: com automation and makeresid

Postby Ravi » Mon May 30, 2011 10:07 pm

First thing to do is to ensure your copy of EViews is fully up to date. We had a recent bug that might make makeresid screwy.
updated to 7.2 but still getting the same output

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: com automation and makeresid

Postby EViews Steve » Tue May 31, 2011 1:48 pm

This is a bug related to the "mode=overwrite" attribute that you're using on the freeze command. Unfortunately, this bug is affecting the base object (temp_resid) as well as the frozen output (temp_resid2).

We will try to get this fixed in the next patch. For now, I would change your script to not use the "mode=overwrite" attribute and instead do the following to delete any pre-existing objects:

Code: Select all

on error resume next app.Run("delete temp_resid") app.Run("delete temp_resid2") on error goto 0 'or whatever your error handler is if you have one
Steve

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: com automation and makeresid

Postby EViews Steve » Tue May 31, 2011 2:09 pm

Actually, another workaround would be to tell the freeze command which view to freeze (in your case, you want the "sheet" view):

Code: Select all

command = "freeze(mode=overwrite,temp_resid2) temp_resid sheet"
That will also made the freeze operation work properly.

Steve


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests