SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 54806: Using R in the Open Source Integration node in SAS® Enterprise Miner(tm)

DetailsAboutRate It

Starting in SAS Enterprise Miner 13.1, the Open Source Integration node enables you to run R code within SAS Enterprise Miner.

 

First, ensure that the RLANG option is submitted when SAS is invoked. Usually, the "-RLANG" option is added to the main sasv9.cfg configuration file for a given SAS installation. In order to verify that RLANG is enabled, run this SAS code:

proc options option=RLANG; run;

View the SAS log. RLANG is displayed if RLANG is enabled. Otherwise, NORLANG is displayed.

NOTE: to find the location of your configuration file, run this code:

proc options; run;

View the log, and view the CONFIG= setting.

 

R and PMML Requirements

  1. Use a standard version of R. The Open Source Integration node has not been tested on optimized R versions with BLAS, Lapack, and so on.

  2. The Open Source Integration node is verified to work with 64-bit R. Using 32-Bit R is not recommended because SAS Enterprise Miner data sources often require large allocations of memory.

  3. The R packages, PMML and XML, are required for the Open Source Integration node’s PMML output mode. To install the PMML and XML packages, follow the steps that are listed in the Open Source Integration Node chapter.

    1. Make sure that you have the recommended versions of R and PMML. The following table lists recommended versions of R for SAS Enterprise Miner releases.

      SAS Version SAS Enterprise Miner release Recommended versions of R Required version of PMML package
      9.4m1 13.1 2.13.0 - 3.2.5 pmml_1.4.1
      9.4m2 13.2 2.13.0 - 3.2.5 pmml_1.4.1
      9.4m3

      14.1

      2.13.0 - 3.2.5 pmml_1.4.2
      9.4m4 14.2 2.13.0 - 3.4.3 pmml_1.4.2
      9.4m5 14.3 2.13.0 - 3.4.3 pmml_1.4.2

      In R on the same machine where SAS Enterprise Miner is installed, run the R command sessionInfo() in order to verify that you have these items:

      1. an appropriate version of R
      2. an appropriate version of PMML
      3. XML
  4. The Open Source Integration Node fails with the latest PMML package, pmml_1.5.2. If you install pmml package from CRAN mirror it will install pmml_1.5.2 so make sure you install the correct version of PMML.

Testing

1.  First, make sure that this simple R code can run successfully in R:

rx <- matrix( 1:3, nrow=1); rm <- matrix( 1:9, nrow=3, byrow=TRUE); rq <- rm %*% t(rx); print(rq)

2.  If the above code runs successfully in R, then complete the following steps:

  1. Create a new diagram in SAS Enterprise Miner.
  2. Drag an Open Source Integration Node to the new diagram.
  3. Set Output Mode = NONE in the properties panel.
  4. Click the Code Editor property ... in the properties panel.
  5. Paste the above R code in the code editor.
  6. Click OK . Right-click the node and choose Run.

 

Troubleshooting tips

1.  You might encounter an error such as this one:

ERROR: The R shared library could not be loaded: filename

If the error occurs, then check whether filename exists and has the correct permissions.

2.  If there is an issue when trying to run R in the Open Source Integration node and SAS/IML® software is installed, then determine whether SAS/IML software communicates with R. If SAS/IML software cannot communicate with R, then the issue is most likely with SAS/IML software, R, or, your operating system – not with SAS Enterprise Miner. If you have SAS/IML, then you can test whether SAS/IML is communicating with R by running this SAS code.  If you get a matrix 14, 32, 50 as the result, then SAS/IML is communicates with R:

proc iml;
submit/R;
rx <- matrix( 1:3, nrow=1)
rm <- matrix( 1:9, nrow=3, byrow=TRUE)
rq <- rm %*% t(rx)
print(rq)
endsubmit;
quit;

3.  If you get an error concerning PMML, then see SAS Note 53794: "The Open Source Integration node gives "ERROR: Given PMML File is not well formed or correct ...""

4.  If a Java error occurs when launching SAS Enterprise Miner, then see SAS Note 56244: "Logging on to a SAS® Enterprise Miner™ server results in the error "java.util.ServiceConfigurationError""

5.  Some operating systems do not support the RLANG system option. The RLANG system option is currently only supported by the Windows and Linux operating systems. The AIX     operating system does not support the Open Source Integration node. If you attempt to submit R statements on a host that does not support the RLANG option, then the following error might be displayed:

6.  If you have a DBCS environment, then see SAS Note 55425: "In a DBCS environment, the Open Source Integration node should not be used with output mode = PMML"

 

 

Helpful Resources

See The Open Source Integration node installation cheat sheet from the SAS Communities page.

Typically, R is installed on the same machine as the SAS Enterprise Miner server. The Open Source Integration Node chapter tells which version of R is verified to work with the Open Source Integration node in each release of SAS Enterprise Miner. Here is a link to the SAS Enterprise Miner documentation page: http://support.sas.com/documentation/onlinedoc/miner/index.html

See the "Open Source Integration Node" chapter in SAS Enterprise Miner Reference Help. To access the chapter from within SAS Enterprise Miner, select Help ► Contents ► Node Reference ► Utility Nodes ► Open Source Integration Node.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Enterprise MinerWindows 7 Professional x6413.1
Windows 7 Professional 32 bit13.1
Windows 7 Home Premium x6413.1
Windows 7 Home Premium 32 bit13.1
Windows 7 Enterprise 32 bit13.1
Microsoft Windows XP Professional13.1
Microsoft Windows Server 2012 Std13.1
Microsoft Windows Server 2012 R2 Std13.1
Microsoft Windows Server 2012 R2 Datacenter13.1
Microsoft Windows Server 2012 Datacenter13.1
Microsoft Windows Server 2008 for x6413.1
Microsoft Windows Server 2008 R213.1
Microsoft Windows Server 2003 for x6413.1
Microsoft Windows Server 2003 Standard Edition13.1
Microsoft Windows Server 2003 Enterprise Edition13.1
Microsoft Windows Server 2003 Datacenter Edition13.1
Microsoft Windows NT Workstation13.1
Microsoft Windows 2000 Professional13.1
Microsoft Windows 2000 Server13.1
Microsoft Windows 2000 Datacenter Server13.1
Microsoft Windows 2000 Advanced Server13.1
Microsoft Windows 8.1 Pro13.1
Microsoft Windows 8.1 Enterprise x6413.1
Microsoft Windows 8.1 Enterprise 32-bit13.1
Microsoft Windows 8 Pro x6413.1
Microsoft Windows 8 Pro 32-bit13.1
Microsoft Windows 8 Enterprise x6413.1
Microsoft Windows 8 Enterprise 32-bit13.1
Windows 7 Enterprise x6413.1
Microsoft Windows Server 200813.1
Microsoft Windows 95/9813.1
Microsoft Windows 8.1 Pro 32-bit13.1
Microsoft® Windows® for x6413.1
Windows 7 Ultimate 32 bit13.1
Windows 7 Ultimate x6413.1
Windows Millennium Edition (Me)13.1
Windows Vista13.1
Windows Vista for x6413.1
64-bit Enabled AIX13.1
64-bit Enabled Solaris13.1
HP-UX IPF13.1
Linux for x6413.1
Solaris for x6413.1
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.