| UCLA Stat Computing Portal |
Web Tools |
ATS Stat Computing |
When you downloaded sas2htm you may have noticed that in addition to
sas2htm.bat
sas2htm.pl
you also downloaded
sas2htmats.bat
sas2htmats.pl
These additional files are the files we use at ATS for making our pages. Our pages include headers at the top that display our toolbar of buttons at the top, and our pages include custom footers at the bottom. Instead of manually adding the toolbar at the top and footer at the bottom every time we make a page, we have included these in sas2htm.pl so every page we create has these headers and footers, and then instead of getting a plain page we get a page with our headers and footers.
You can look at sas2htmats.pl and see where we have added these headers and footers, and you can make your own custom copy of sas2htm.pl and sas2htm.bat that include your own custom headers and footers. Here are some examples of sas2htm.pl that you can change.
You can change the section shown below to change any SAS options that will be in effect when you generate your page. For example, we set the FORMCHAR option to make the tables appear nicer.
# USER CONFIG #1, SAS OPTIONS print O "* SAS Options to make web page look better ;\n"; print O "OPTIONS NODATE NOCENTER NONUMBER FORMCHAR='\|----\|+\|---+=\|-/\<>*';\n"; print O "TITLE ;\n";
In this section you can add or change any tags that you want to appear in the <head> section of your web page.
# USER CONFIG #2, head tags, title tags, start body print O "* Title section ;\n"; print O "DATA _NULL_;\n"; print O " FILE \"$ARGV[2]\" ;\n"; print O " PUT \"<html>\";\n"; print O " PUT \" \";\n"; print O " PUT \"<head>\";\n"; print O " PUT \"<title>$TITLE<\/title>\";\n"; print O " PUT \"</head>\";\n"; print O " PUT \"<body>\";\n"; print O " PUT \"<h1 align='center'><font color='#000080'>$TITLE</font></h1>\";\n"; print O " PUT \" \";\n"; print O "RUN;\n\n";
In this section, you can add or change anything that you want to appear at the end of the page, such as a footer.
# #5, USER CONFIG, FOOTER print O "* Footer ;\n"; print O "DATA _NULL_;\n"; print O " FILE \"$ARGV[2]\" MOD ;\n"; print O " PUT \"</body>\" ;\n"; print O " PUT \"</html>\" ;\n"; print O "RUN;\n";