If you prefer to enter code directly into your SAS program rather than use windows, use the Data Set Formatter in batch mode to convert a SAS data set into an HTML file. The following instructions describe how to invoke the Data Set Formatter and generate results in batch mode.
Rather than work in batch mode, you can work with Data Set Formatter interactively using windows. For information, see Formatting a Data Set Interactively.
To invoke the Data Set Formatter and format a data set into an HTML file:
Type and submit
HTMLFILE=FILENAME); in the Program Editor. The argument
RUNMODE=B indicates that the Data Set Formatter will run in
batch mode. If you are including other arguments, include them inside the
parentheses, for example:
%ds2htm(runmode=b, htmlfile=myfile.html, data=saleall, where=year eq 1996, var=year quarter dept amt, rowssvar=quarter, sum=amt, caption=1996 Sales Total per Department, ssfile1=comments.txt);
Note: If you are running your SAS program as a batch process,
start the SAS session using the
Specify general options that affect the processing of the data and the entire HTML page. The above example describes some of the arguments you can enter in the SAS program.
For a complete description of all the Data Set Formatter arguments, required arguments, and syntax explanations, see HTML Data Set Formatter: Macro Syntax Reference.
Select variables you want to appear in your HTML-formatted
table. Use the
var=var1 var2 ... argument.
Optionally, select ID variables you want to appear in your HTML-formatted file. Using ID variables may be helpful if you want to distinguish certain variables from others. For example, you can use one color for ID variables and another for the other variables. Enter the following:
id=var1 var2 ...
Optionally, select SUM variables that appear as
totals or sums in your HTML-formatted
file. These variables must be numeric, not character.
sum=var1 var2 ... argument.
Ensure that you included a comma after each argument and a semicolon at the end of the Data Set Formatter macro call.
To format the data set, submit the program. The Data Set Formatter retrieves the data from the data set, adds the HTML tags, and creates the HTML-formatted file.
You can change the properties that govern how the data appears in your HTML table.
After processing the results, enter the URL (including the HTML filename) in the browser window to look at your HTML-formatted table.
Note: You can run the program again using a different property list. Specify the list using the PROPLOC argument. For details, see the Macro Reference Syntax.