As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Web

From sasCommunity
Jump to: navigation, search

Overview

SAS can be exposed in many different ways on the web depending upon what a user wants or needs to do. The first major distinction is whether a SAS dataset needs to be exposed for reading or whether a user needs the ability to input values and submit a SAS job.

Reading a SAS dataset

A SAS dataset is both OleDb- and ODBC-compatible. Free drivers for both can be found on the SAS website. Using either one of these drivers allows a web developer to easily read in a SAS dataset and expose the information on the web. However, there are some serious issues related to either technique:

  • Formatted values come across as their original value and not the formatted value. hence, dates come across as integers
  • There is a technique for displaying formatted values correctly but if this mechanism is employed, ALL values come across as strings

There is a third option which is to use an XML based dataset as a means of getting data into and out of SAS.

Interacting With SAS

If interaction with SAS is desired (inputting parameters and getting results), then the techniques are numerous. However, license restrictions may require a license for SAS/IntrNet or SAS Integration Technologies.

SAS/IntrNet has the Application Dispatcher as a component. It is a CGI solution that takes in parameters as command line arguments and submits SAS programs using the arguments. SAS/IntrNet is small, light-weight, and extremely fast but suffers from the limitations imposed by CGI. In reality, the CGI limitations can be of little to no consequence but a developer should have them in mind prior to developing a website.

SAS Integration Technologies is a COM-based approach and is the way that SAS uses for interacting with the web. It is very robust and supports many advanced features.

There are many additional ways of submitting SAS using parameters but license restrictions may preclude their use.

HTML

 <HTML>
 <INPUT TYPE="Button" NAME="RunSAS" VALUE="Do New Analysis">
 <SCRIPT FOR="RunSAS" EVENT="onClick" LANGUAGE="VBScript"> 
 Dim objSAS
 Set objSAS = CreateObject("SAS.Application")
 objSAS.Submit("%include 'C:\test.sas';endsas;")
 </SCRIPT>
 </HTML>