Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next

Creating Dispatcher Applications with Print of a Data Set

This application shows how to display output from PROC PRINT.


The Input Component

This sample uses the HTML Output Formatter, one of the HTML Formatting Tools that is provided by SAS, to create an HTML-formatted output from PROC PRINT. This tool will produce all of the HTML output for this application. The only input controls are combo boxes that allow you to choose the type of service and the debug level.

The HTML code for this application is installed with the Dispatcher package in a default location of http://yourserver/sasweb/IntrNet8/dispatch/webohtm.html.


The Program Component

The SAS code to process this form is again made easy by using the HTML Formatting Tools. These tools can be used in Dispatcher programs to provide power and flexibility while saving you a lot of programming effort.

The Output Formatter is invoked by calling the macro %out2htm and supplying it with a set of arguments. To begin capturing SAS procedure output, specify the argument capture=on. When all of the desired SAS procedure output has been generated, run %out2htm again, this time specifying the capture=off argument.

Here is the source code illustrating this technique, which was extracted from the Dispatcher program:

   %out2htm(capture=on);

   proc print data=sashelp.retail noobs;
      sum sales;
   run;

   %out2htm(capture=off,
      htmlfref=_WEBOUT,
      runmode=s,
      openmode=replace,
      bgtype=color,
      bg=white,
      encode=n,
      tcolor=blue,
      ttag=header 3,
      septype=none,
      brtitle=Sample Output Formatter Program);

The argument RUNMODE=S instructs the Output Formatter to print the required HTTP header before creating any output. We could have used a DATA step to do this, but the RUNMODE argument is more convenient.

Another requirement of all Dispatcher programs is to make sure that the output is directed to the fileref _WEBOUT. The Formatting Tools accept the argument HTMLREF=. Supplying a value of _WEBOUT for this argument directs the Formatter output to the Web browser.

The complete code for this Dispatcher program is installed in the Application Server sample library in a file named webohtm.sas.


Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next