SAS/IntrNet 1.2: Application Dispatcher |
Tabulate ProcedureThis application illustrates the computational power of the Application Dispatcher. The HTML form provides options that perform different tabulations of the same set of data. This capability is possible because the Dispatcher is more than just a data server. The HTML PageThe HTML page for the Tabulate Procedure application is quite simple. It contains a set of four check boxes, a selection list, and a submit button. This sample application uses the HTML Tabulate Formatter, one of the HTML Formatting Tools provided by SAS, to create an HTML-formatted table. This tool will produce all of the HTML output for this application! The user interface is not fancy, but the capabilities that it highlights are very noteworthy. By selecting the various check boxes, the user controls which variables will be tabulated in the resulting table. The check boxes on this form allow users to select the statistics to display. Check boxes are created by using the Number of Sales Average Sale Smallest Sale Largest Sale A selection list field is provided from which the user can select a row variable. The selection list begins with the <SELECT> tag and ends with the </SELECT> tag. A name attribute is assigned to the field within the select tag. Items are added to the selection list with <OPTION> tags. This selection list code lets the user choose a row variable to tabulate. <SELECT NAME="row"> <OPTION VALUE="year*month">Year and Month <OPTION VALUE="year">Year <OPTION VALUE="month">Month </SELECT> These two components along with some descriptive text and a submit button complete the form. The HTML code for this application can be found in the Broker package sample directory in a file named tabulate.html. The code produces a form that looks like this: For more detailed information on creating the input component of a Dispatcher application, see Input Component Details. The Dispatcher ProgramThe Dispatcher program for this application is very simple, thanks to the Tabulate Formatter. The Tabulate Formatter works by a capture on/capture off mechanism. A macro call is made to In addition to turning capture mode off, the Tabulate Formatter must be instructed where to send the generated HTML. Because all HTML output produced by Dispatcher programs should be sent to fileref Lastly, recall from the hello program that each Dispatcher program must return an HTTP header followed by a null record. Here is an example: put 'Content-type: text/html'; put ; The parameter Using the Tabulate Formatter in a Dispatcher program takes this general form: %tab2htm(capture=on); proc tabulate data=data set FORMCHAR='82838485868788898a8b8c'x; more proc tabulate steps . . . %tab2htm(capture=off, htmlfref=_webout, runmode=s, openmode=replace); The complete code for this Dispatcher program is contained in the Application Server package in a file named tabulate.sas. Based on the selection that the user makes on the HTML form in this application, one of three values is passed to this program in the variable One of SAS software's greatest strengths is that it provides you with an extensive, powerful array of analytical procedures such as the tabulate procedure. Procedures to perform cross tabulations, charts, statistical analysis, summaries, and graphics can be leveraged in your Dispatcher applications. This is much much more than a data base tool! Read the other example application sections to learn more or jump right to the details about the program component in Dispatcher Program Details. |
SAS/IntrNet 1.2: Application Dispatcher |