Set Up SAS to Use the SAS/LabKey Interface

The LabKey/SAS client library is a set of SAS macros that retrieve data from an instance of LabKey Server as SAS data sets. The SAS macros use the Java Client Library to send, receive, and process requests to the server.

Configure your SAS installation to use the SAS/LabKey interface:

  1. Install SAS
  2. Build the labkey-remote-api-1.0.jar and locate the five jars files it depends on
  3. Open the default SAS configuration file, SASV9.CFG (in C:\Program Files\SAS\SAS 9.1\nls\en on Windows installs)
  4. In the -SET SASAUTOS section, add the path to the SAS macros to the end of the list (e.g., "C:\labkey\remoteapi\sas\macros")
  5. Configure Java runtime and classpath depending on your SAS version:
  • Instructions for SAS 9.1.x
    • SAS 9.1.x installs a 1.4 Java runtime; you must install a 5.0 or 6.0 JRE and change -Dsas.jre.home= to point to it
    • Add -Dsas.app.class.path= full paths to all seven jar files separated by ;
  • Instructions for SAS 9.2
    • No configuration of the Java runtime is necessary on SAS 9.2 since it installs a 5.0 JRE
    • You must set the system CLASSPATH environment variable to the full paths of all seven jar files separated by ;
Configure LabKey Server and run the test script:
  1. On your local version of LabKey Server, configure a list called "People" in your home folder and import demo.xls to populate it with data
  2. Configure your .netrc or _netrc file in your home directory
  3. Run SAS
  4. Execute "proc javainfo; run;" in a program editor; this command should display detailed information about the java environment in the log. Verify that java.version matches the JRE you set above.
  5. Load demo.sas
  6. Run it
You may also be interested in an experimental, unsupported feature of LabKey SAS support: Configure SAS Access From LabKey Server.


previousnext
 
expand allcollapse all