Desktop productivity for business analysts and programmers

R call through SAS/IML doesn't work in SAS Enterprise Guide

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

R call through SAS/IML doesn't work in SAS Enterprise Guide

I have SAS Enterprise Guide 4.3 installed on my computer. It is connected to a SAS 9.3 on a server. This work great but if I get an error when I run a SAS program calling R. The server administrator modified the sasv9.cfg file in order to include the -RLANG option. I executed my code in batch on the server and here is the log:

1      PROC OPTIONS OPTION=RLANG;
2      RUN;

SAS (r) Proprietary Software Version 9.3  TS1M0

RLANG        
Support access to R language interfaces

NOTE: PROCEDURE OPTIONS used (Total process time):

  real time       0.00 secondes
  cpu time        0.00 secondes

3    
4      PROC IML;

NOTE: IML Ready

5            SUBMIT / R;
6            a <- 2
7            paste("a:",a)
8            b <- 3
9            paste("b:",b)
10           c <- a * b
11           paste("c:",c)
12     ENDSUBMIT;
13     QUIT;

NOTE: Exiting IML.

NOTE: The PROCEDURE IML printed page 1.

NOTE: PROCEDURE IML used (Total process time):

  real time       0.24 secondes
  cpu time        0.03 secondes

If you executre the same code within SAS Enterprise Guide on the same server, the log is:

15     PROC OPTIONS OPTION=RLANG;
16     RUN;

SAS (r) Proprietary Software Version 9.3  TS1M0

RLANG         Support access to R language interfaces

NOTE: PROCEDURE OPTIONS used (Total process time):

  real time       0.00 secondes
  cpu time        0.00 secondes

17   
18     PROC IML;

NOTE: IML Ready

19           SUBMIT / R;
20           a <- 2
21           paste("a:",a)
22           b <- 3
23           paste("b:",b)
24           c <- a * b
25           paste("c:",c)
26     ENDSUBMIT;

ERROR: SAS could not initialize the R language interface.

statement : SUBMIT at line 19 column 7

27     QUIT;

NOTE: Exiting IML.

I don't understand why it doesn't give the same results. I already had the same error in batch when R_HOME was not defined.


Accepted Solutions
Solution
‎04-30-2012 03:31 PM
SAS Employee
Posts: 25

Re: R call through SAS/IML doesn't work in SAS Enterprise Guide

They key is likely in your statement, "I already had the same error in batch when R_HOME was not defined"

From EG, submit :  %put %sysget(R_HOME) ;  is the correct path returned?   If not, you'll need to modify one of the SAS start-up scripts to define it.  A good place would be <SASHOME>/SASFoundation/9.x/bin/sasenv_local, as this file will be sourced by all SAS sessions launched on the system.

View solution in original post


All Replies
Trusted Advisor
Posts: 2,114

Re: R call through SAS/IML doesn't work in SAS Enterprise Guide

My guess is that the R subsystem is run using the equivalent of an 'x' command.  By default, "X" commands are not supported via EGuide.  If so, that's why it is being blocked.  The system administrator can allow execution of "X" commands under EGuide.

You may want to call tech support for confirmation.

Doc Muhlbaier

Duke

SAS Super FREQ
Posts: 3,630

Re: R call through SAS/IML doesn't work in SAS Enterprise Guide

No, we do not use the 'X' command to call R.

I can run your program in EG 4.3 without error, so the problem is particular to your configuration. Please contact Technical Support so they can help you resolve this problem.

Solution
‎04-30-2012 03:31 PM
SAS Employee
Posts: 25

Re: R call through SAS/IML doesn't work in SAS Enterprise Guide

They key is likely in your statement, "I already had the same error in batch when R_HOME was not defined"

From EG, submit :  %put %sysget(R_HOME) ;  is the correct path returned?   If not, you'll need to modify one of the SAS start-up scripts to define it.  A good place would be <SASHOME>/SASFoundation/9.x/bin/sasenv_local, as this file will be sourced by all SAS sessions launched on the system.

New Contributor
Posts: 2

Re: R call through SAS/IML doesn't work in SAS Enterprise Guide

You were right. The system variable R_HOME was no more defined. I modified the sasenv_local as suggested and now it works.

Thank you.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 2445 views
  • 0 likes
  • 4 in conversation