HTML Tabulate Formatter

Capturing TABULATE Output Interactively

The HTML Tabulate Formatter lets you easily format and save output from the TABULATE procedure into HTML files. The following instructions describe how to invoke the HTML Tabulate Formatter and capture results from the TABULATE procedure.

There are two ways to work with the HTML Tabulate Formatter:

You can use the HTML Tabulate Formatter interactive window to capture PROC TABULATE results. This method is referred to as running in interactive mode. On the other hand, you can enter an HTML Tabulate Formatter macro call directly in a SAS program. This is referred to as running in batch mode. For details, refer to Capturing Tabulate Output in Batch Mode or the Tabulate Formatter usage examples.

The HTML Tabulate Formatter captures data differently when running in batch versus interactive mode. When running the HTML Tabulate Formatter interactively, you must generate the results and display them in the Output window before you can capture the information. When running in batch mode, you actually capture the output as it is being generated.

Before Invoking the Tabulate Formatter Window

Complete the following steps before you display the HTML Tabulate Formatter window:

  1. Ensure that the your program generates only output from the TABULATE procedure. If your program generates output from any other SAS procedure, the HTML Tabulate Formatter will fail. If necessary, clear the window before submitting the program. To capture other types of output, use the HTML Output Formatter.

  2. Enter or display your program in the Program Editor.

  3. Set SAS system options in your SAS program.

    You must set the line size (ls=) and FORMCHAR (FORMCHAR=) system options before you capture output from the TABULATE procedure.

  4. Use the following line to make sure that the ODS LISTING destination is open:

       ods listing;
    
  5. Submit the program. SAS software writes log messages to the Log window and your results to the Output window.




Invoking the HTML Tabulate Formatter Window

To invoke the HTML Tabulate Formatter window, submit the following in the Program Editor:

   %TAB2HTM(RUNMODE=I);

The HTML Tabulate Formatter window appears.

Tabulate Formatter screen capture

In addition to RUNMODE=I, you can include the following arguments when you invoke the HTML Tabulate Formatter window. Many of the arguments in the following table are not available in the HTML Tabulate Formatter window. The only way to specify the information represented by these arguments is to include them with your macro invocation. If you specify an argument that is available in the window, the window will reflect the argument value that you supplied with the macro invocation. See the syntax reference for information about how to specify each of these arguments.



htmlfile saspower cclass rlclass sstype1-sstype5
openmode charset clclass rlwrap ssrel1-ssrel5
doctype tranlist clwrap sepclass ssrev1-ssrev5
pagepart bclass cnclass spclass sstitle1-sstitle5
brtitle bdclass dclass tclass ssmedia1-ssmedia5
proploc bxclass dwrap tbclass ssfile1-ssfile5
encode bxwrap fclass sshref1-sshref5 ssfref1-ssfref5
formchar  

Specifying General Settings

To capture output interactively, complete the Tabulate Formatter window.

Note: You cannot use macro variables, macro invocations, or macro functions (including %NRSTR) in any of these fields because they will not resolve. However, you can use them when running this tool in batch mode.

  1. Enter information in the following fields on the Tabulate Formatter window:

    • HTML File Name: Specify a filename to which your HTML-formatted output will be written. Type the fully-qualified path and filename, or select the arrow button to the right of the field to browse your directory structure.

    • Property List Name: The name of the property list that governs the format of your output appears here. SASHELP.HTMLGEN.TABPROP.SLIST is the default property list. To use another property list, type the complete four-level name, or select the arrow button to choose from a list.

      You can change the formatting rules by creating a different property list. For details, see Customizing Properties.

    • Browser Window Title: Enter the text you want to appear in the browser window title bar.

    • Transcoding List Name: Specify the name of the list that you want to use to transcode your data from one encoding to another. This field is optional. However, if you provide a transcoding list name, you may also need to provide a Character Set Name.

      You can use a list that we provide or one that you create using MAKETL macro. For more information, see National Language Support.

    • Open Mode: To append new data to an existing HTML file, select Append. (If you select Append, you must specify an existing file in the HTML File Name field.) To replace existing data, select Replace.

    • Encode: To have the Tabulate Formatter check for the characters "<" and ">" and encode them as Numeric Character References (NCR), select Yes. This will display the actual brackets in the browser. By default, the brackets will be encoded. To have the Tabulate Formatter pass the brackets as is to the browser (where the browser will attempt to act on them as an HTML-formatting instruction), select No.

    • Character Set Name: Enter the name of the character set should appear in the <META> tag in your HTML file. Character set names vary based on the browser you are using. Therefore, the Formatting Tools do not perform any error checking on this value.

  2. To capture the output, select OK. The Tabulate Formatter captures the output, adds the HTML tags, and writes it to the HTML file.

  3. To look at your HTML file, enter the appropriate URL in your browser window.


Push Buttons

The HTML Tabulate Formatter window includes the following push buttons. If you have omitted a required field, an error message appears at the top of the window, and the cursor is positioned in the appropriate entry field.

Help
The Help push button displays a window that provides the URL for the documentation that is located on the SAS Web site. If you have installed the Web Publishing Tools documentation package at your site, you may want to refer to your local copy of the documentation instead of returning to our Web site. However, the documentation that is provided on the SAS Web site might contain updated and enhanced information as well as address changes to the Formatters.

Properties
The Properties push button displays the HTML Tabulate Formatter Properties window, which enables you to change the property settings. For more information, see Customizing Properties Interactively.

OK
Select the OK push button when you are ready to submit your selections on the HTML Tabulate Formatter window and capture your output.

Cancel
Select the Cancel push button to exit this window without capturing any output.

Recapturing the Same Output Using Different Properties

When you use the Tabulate Formatter interactively, it captures the output the is currently displayed in your Output window. As long as the output you want to capture remains in the window, you can capture it over and over again using different property settings.

All you need to do is create a custom property list, specify the name of that list in the Property List Name field, modify the property settings, then select OK. You can continue modifying the properties and recapturing your output until you get the look you desire for your output -- without rerunning PROC TABULATE.