Using HTML Formatting Tools

The HTML Formatting Tools are often used to produce Application Dispatcher program output. There are some important guidelines to follow when using the Formatting Tools in an Application Dispatcher program.
  • When using the Output Formatter and Tabulate Formatter mechanism, do not forget to turn capturing off before the program completes. Each capture=on needs to have a corresponding capture=off. The Application Server is not guaranteed to turn off these tools for you.
  • The listing output destination must be active or these two tools do not work. The listing destination is active by default when you start SAS, and it is also turned on in the default server reset file. However, it is possible that the listing could be closed if you remove the ODS statement from your reset file and explicitly turn it off in one of your programs. If you need to turn the listing on, then submit the following before you invoke the capture=on mechanism for either the Tabulate or the Output Formatter:
    ods listing;
  • Use RUNMODE=S with each of the tools. This RUNMODE value designates that the tools are running in server mode. If openmode=replace is used along with this run mode, then the tools generate a Content-type: text/html header automatically.
  • Use openmode=replace if this call to one of the tools is creating the first output from this program. This open mode causes the formatting tools to generate the header (if RUNMODE=S), the HTML head section of the document, and body tags.
  • Use openmode=append if this call to one of the tools is not creating the first output from this program. If the program has already produced some output, then it has already supplied the content-type header and most likely the HTML head section, as well.
The Application Dispatcher is a very flexible programming environment because it provides procedures and tools that automatically generate output, but it also allows exact control of the output. Many SAS programmers have encountered the situation where they want to generate completely customized output. This is often done by using the DATA step and PUT statements. The Application Dispatcher technology supports PUT statement reporting and enables you to supplement such reports with powerful procedures and Formatting Tools.