UCLA Stat Computing Portal Web
Tools
ATS Stat
Computing
 

Downloading and Installing sas2htm

These notes show how to download and use the tool sas2htm that ATS has developed to make it easy to convert a SAS program into a web page.  These tools assume that you have downloaded and installed SAS Version 8 on your computer.

  1. Download the files.
    Click on sas2htm.exe and choose to run it.  When it asks you "Unzip to folder?" we will assume you choose c:\sas2htm .  If you install it somewhere different, then replace c:\sas2htm to the name of the directory where you stored this file.
  2. Install Perl
    One of the files extracted into c:\ will be called pw32i316.exe . Double click on that file which will install perl on your machine.  You can install this into any directory you choose, but we will assume you install it in c:\perl .  Wherever you see us refer to c:\perl you can replace that with the directory that you chose.  (If you have installed sas2htm then you probably have installed perl, so you can skip this step).

    The installation program will questions about installing it, and the default should be fine for all of the questions.  The most important question is "Modify search path?", and you should answer yes.  This will make it easy to find the tools needed for running sas2htm.
  3. Move the sas2htm files to the Perl Folder
    In the c:\sas2htm folder you will find the files sas2htm.bat and sas2htm.pl .  Move these files from c:\sas2htm to c:\perl\bin .
  4. Edit sas2htm.bat 
    Use notepad (or any other text editor) to open up the file sas2htm that is located in your c:\perl\bin directory .  It will look like this...

    c:\perl\bin\perl c:\perl\bin\sas2htm.pl %1.sas %1.tmp.sas %1.htm %1.sas.txt
    "c:\program files\sas institute\sas\v8\sas" %1.tmp.sas


    Check to see if you need to make the following 2 changes...
    - If you installed perl in a place other than c:\perl, change c:\perl to the name of the location where you installed perl.
    - Locate sas.exe on your computer (You can right click on my computer and choose find and then search for sas.exe to see where sas.exe is installed).  If your sas.exe is located in a place different than c:\program files\sas institute\sas\v8\sas then change that to be the location of sas.exe.
  5. Reboot your computer (to make sure that the paths that perl set will take effect).
  6. Test sas2htm
    Start a Dos Window (e.g. click start then programs then command prompt). Then type
    cd c:\sas2htm 
    You can then try converting the test program sample1.sas (a SAS program that is ready to be converted to a web page) to sample1.htm by typing
    sas2htm sample1
    This should then create sample1.htm.