Trouble with RConn

For questions regarding programming in the EViews programming language.

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

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Trouble with RConn

Postby CNR15 » Fri May 12, 2023 6:28 am

– I am working on a database in EViews that uses an external interface to R to perform certain tasks such as extracting data from Eurostat or performing transformations either not available or very difficult in EViews.

I keep getting the attached message however when doing this. The task is usually successful but I sometimes will wait 30 mins or so – even for relatively small transformations. Other times it will just crash EViews.



Has anyone else had this issue? It is the same on and off my organisations VPN so I don't think its a network issue.

The version is EViews RConn x64 (R Version 4.1.1) so was thinking it might be an update issue?


CNR
Attachments
Sever Busy.GIF
Sever Busy.GIF (18.18 KiB) Viewed 8957 times

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

Re: Trouble with RConn

Postby EViews Steve » Fri May 12, 2023 2:53 pm

The "Server Busy" dialog will appear when Windows COM (used by EViews to talk to R in this case) doesn't hear back from R within a certain time frame (I believe 60 seconds is the default).

If you want EViews to wait forever during it's calls to R, you can use the COMTIMEOUT command (introduced in EViews 10) to set the timeout value to zero BEFORE you call XOPEN, like this:

Code: Select all

COMTIMEOUT(0)
XOPEN(r)
This should prevent the "Server Busy" dialog from appearing.

Now as to why your R call is taking longer than 60 seconds, you'll have to debug that on the R side. The most likely reason is because Eurostat itself is busier at certain times than others. So if your R code is downloading data from Eurostat, then that's where I would look first. Try writing to an external log file (or the console) both before and after the download so that you can see how long various steps are taking.

After looking at your timestamps, if you still think the slowness is with EViews, please provide the following details:
1. Your EViews version and build date (make sure you install the latest patch for your version if you haven't already)
2. Your R version and bitness (32 or 64?)
3. If possible, provide a short EViews program (or R program) that can replicate the issue.

Steve

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Tue May 16, 2023 9:48 am

Hi Steve - Thanks for getting back to me on this. It doesn't seem to work no matter what the function is. Even this simple example of seasonal adjustment stalls and displays the same message. And in this case just stays busy without carrying out the command.

Here are details you asked for.

Your EViews version and build date: EViews 12 and March 3 2021
Your R version and bitness: R Version 1.4.1717 (64 bit)




'wfcreate u 2
'string x13locale
'x13locale = %9
'xopen(r)
'xput(rtype=list, name=x13locale) x13locale
'xrun install.packages("seasonal", repos="http://ftp.heanet.ie/mirrors/cran.r-project.org/")
'xrun X13_PATH = x13locale
'xrun Sys.setenv(X13_PATH = x13locale)
'xrun library(seasonal)
'xrun checkX13()
'xclose
'wfclose untitled

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

Re: Trouble with RConn

Postby EViews Gareth » Tue May 16, 2023 10:55 am

X13 is probably not a great test function. It is slow in R, and is complicated (since R itself is calling an external application).
Follow us on Twitter @IHSEViews

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Wed May 17, 2023 12:28 am

No worries Gareth - here is a more staright forward command. Just one variable from Eurostat which again stalls and can take up to 30 mins due to server busy issue.

xopen(r)
xrun library(SmarterPoland)
xrun tmp <- getEurostatRCV("irt_lt_mcby_q")
xrun tmp$time<- as.numeric(as.character(tmp$time))
xrun dat.m <- subset(tmp,(geo=="DE")& (int_rt=="MCBY") )
xrun dat.m$new<-(nrow(dat.m):1)
xrun library(reshape)
xrun castdata <- cast(dat.m,new ~ geo, value="values")
xrun castdata$new <- NULL
xget(name= GE_Q_R , type=series) castdata

GE_Q_R.label(d) Germany, EMU convergence criterion bond yields
LGE_Q_R.label(s) Eurostat, irt_lt_mcby_q

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Wed May 17, 2023 8:42 am

Just an update question - I have updated R to the most recent version (R version 4.3.0). Now when I run xopen(r) I get the below message.


Any idea how to resolve this?

Thanks!
Attachments
error.GIF
error.GIF (40.81 KiB) Viewed 8810 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Trouble with RConn

Postby startz » Wed May 17, 2023 11:34 am

Go to options/General options/External program interface and change the path.

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Wed May 17, 2023 1:53 pm

Thanks startz!

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Thu May 18, 2023 2:53 am

Just to update the Updated R Version 4.3.0 has same issue. Server busy message appears and can be 30 mins plus for even a single series.

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

Re: Trouble with RConn

Postby EViews Steve » Thu May 18, 2023 9:24 am

I tried running your latest program using EViews 12 (Nov 4, 2022) and R v4.3.0 and it ran quickly (less than 5 seconds) and without issue.

Are you running this program from within the EViews GUI or are you running it differently? (such as via the command line or maybe even via COM automation?)

I suggest you update your EViews 12 to the latest version since it's more than a year older than what's available.

Also, try turning on LOGMODE at the start of your program and have it display each program line that is running so you can see where it hangs, like this:

Code: Select all

logmode(filename="c:/files/out.txt", autosave=on) p
(I also turned on autosave and specified an output filename so each log will get saved to the external file in case you're not using the EViews GUI).

CNR15
Posts: 26
Joined: Thu Sep 16, 2021 7:06 am

Re: Trouble with RConn

Postby CNR15 » Mon May 22, 2023 2:34 am

Thanks Steve!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 27 guests