The URL now includes the appended parameters after a question mark character:
http://hygelac/cgi-bin/example5-3.pl?input=-40&convert=1
These are the values from the form on the preceding Web page. For the current page and any subsequent ones, the URL will now include these name/value pairs.
One of the advantages of URL rewriting is that when a Web page is bookmarked, the name/values pairs are also stored. In this way a CGI program can be recalled at a later date without re-entering the form values. The main drawback to this approach is that it doesn’t work very well for login screens, since the password would be appended to the URL and could be stored in the bookmark!
There is an easy way around the problem, which is simply to change the form method from get to post. In the latter method, parameters are included in the page that is sent, but they are not displayed in the URL. If the page is bookmarked, however, the parameter values are not saved and the form information must be re-entered.
SAS makes use of name/value pairs to communicate with a SAS server. The methods available are quite powerful, but somewhat complex; they form the subject of the next two chapters on the Application Dispatcher and htmSQL.
References
Learning Perl
Cassell, David L. 2001. “A Perl Primer for SAS Programmers.” Proceedings of the Twenty-Sixth Annual SAS Users Group International Conference. Cary, NC: SAS Institute Inc.
Lash, David A. 2002. The Web Wizard’s Guide to Perl and CGI. Boston, MA: Addison- Wesley.
Schwarz, Randal L., and Tom Phoenix. 2001. Learning Perl. 3rd ed. Sebastopol, CA:
O’Reilly & Associates.
Links
URL references are current as of the date of publication.
CGI on Apache – http://httpd.apache.org/docs-2.0/howto/cgi.html
Common Gateway Interface – http://hoohoo.ncsa.uiuc.edu/cgi/intro.html
Perl Tutorials –
http://directory.google.com/Top/Computers/Programming/Languages/Perl/WWW/
Tutorials/
Using CGI on IIS – http://msdn.microsoft.com/library/default.asp?url=/library/
en-us/vccore98/HTML/ _core_how_does_isapi_compare_with_cgi.3f.asp
C h a p t e r 6
SAS/IntrNet: the Application Dispatcher
Overview 101
Installing the Application Broker 102
Creating an Application Dispatcher Service 106
Defining an Application Dispatcher Service for UNIX or Linux 106 Defining an Application Dispatcher Service for Windows 108 Configuring the Default Application Service 109
Starting and Stopping the Application Server 110 Testing the Application Service 112
Defining Application Server Libraries 117 Debugging SAS Output 119
Generating Dynamic Output with the Output Delivery System 122 References 125
Overview
The first Web technology introduced by SAS was the SAS/IntrNet software product, a suite of CGI-based Web applications. The other SAS AppDev Studio components—
webAF and webEIS— are used to develop Java applets and JavaServer Pages. In contrast, using SAS/IntrNet requires no Java or Perl programming and consequently is well-suited to sites where these programming resources may not be available.
SAS/IntrNet software provides two sets of CGI-based tools: Compute Services (Application Dispatcher) and Data Services (htmSQL). This chapter and the following one consider each of these in detail. In addition, several additional special-purpose components are available, including the SAS Design-Time Controls (see Appendix C,
“SAS/IntrNet: Design-Time Controls”) and the SAS/CONNECT and SAS/SHARE drivers for JDBC.
The most complex of these both in terms of installation and use is the Application Dispatcher. Once the various software components have been properly configured, however, interacting with the Application Dispatcher requires no particular expertise on the part of the Web user. An investment in understanding the details of this product thus provides a relatively high level of functionality for a small ongoing resource outlay.
The Application Dispatcher itself consists of four components:
Input – an HTML form to supply parameters
Program – a SAS program to process the data from the form
Application Server – a background SAS session to run the program
Application Broker – a CGI program to pass the data from HTML to the Application Server
The latter two are supplied by SAS as part of SAS/IntrNet software; instructions for deploying them are included in the SAS online documentation.
The remaining two elements are user supplied. The input component is usually an HTML form, but it can be any element that includes a reference to the Application Dispatcher, such as a Java applet or ActiveX control. As the documentation notes:
Regardless of the mechanism used, it must minimally send a service ID (passed in the _SERVICE field) and the name of the program (passed in the _PROGRAM field) to the broker (that is the CGI program).1
The rest of this chapter is an effort to illuminate this somewhat cryptic instruction.
Installing the Application Broker
In contrast to most of the SAS installation procedure, SAS/IntrNet installation requires some degree of foreknowledge.2 Although most of the software is installed automatically by the SAS setup routines, the Application Broker software must be configured manually.
The first puzzle is that the necessary software is included on the installation CD labeled
“SAS Client-Side Components.” This is somewhat peculiar, since the Application Broker is not a client application but a Web server one!
The SAS/IntrNet installation procedures have been revised somewhat for SAS®9, making the process more straightforward. First, open the Software Navigator from the “SAS Client-Side Components Volume 2” installation CD for SAS 9.1.3. For UNIX systems, this is accomplished by running the shell file setup.sh, while on Windows systems the corresponding file is setup.exe. Choosing SAS/IntrNet in the left-hand window opens the menu shown in Display 6.1.
1 SAS Institute Inc., 2001. Getting Started with SAS AppDev Studio (Cary, NC: SAS Instistute Inc.), 31.
2 The one-day class on SAS Web Tools: SAS/IntrNet Administration includes a session on configuring the Application Dispatcher. For a more general introduction, SAS also offers the course SAS Web Tools: Overview of
SAS Web Technology.
Chapter 6 SAS/IntrNet: the Application Dispatcher 103