Hazard Package Installation

This documents the steps required to install the Hazard package on to your computer system. There are four basic steps to getting the system up and running on your system.

  1. Verify your SAS installation.
  2. Compile the source code.
  3. Install the binary executables.
  4. Setup the system and SAS environments.

Throughout the document, we will note platform specific steps by either Windows or UNIX. Our UNIX experience is taken from the Solaris platform, but should be useful for all UNIX variants. Our Windows experience is taken from Windows 2000, other versions are noted where possible.

Verify your SAS installation.

The Hazard package requires SAS for pre and post processing of data and result sets. Hazard has been successfully run on many versions of the SAS ® system. Hazard Version 4.1.x has been tested on SAS V 6.12 and V 8.x.

  • You can test your version of SAS ® by simply executing the SAS command.
  • UNIX: From the command line, issue the SAS command.
  • Windows: From the start menu go to Programs and look for the SAS or SAS Institute program group and open the SAS program.

Return to Top

Compile the source code

If you downloaded the platform specific pre-compiled versions of the package, currently available for the Windows and Solaris platforms, you can skip to the next section.

If you are running a platform besides Windows or Solaris, you must compile your own executables from the source code distribution.

The HAZARD package written entirely in ANSI standard C, and uses lex and yacc for parsing its input commands. You must have equivalent compilers installed on your system before attempting to install HAZARD. Fortunately, all the tools required are available for many platforms from through the GNU project. The GCC C compiler system can be downloaded from gcc.gnu.org. You can also download the flex lexer and bison parser to perform the lex and yacc functions.

Compiling the source code has been greatly simplified in Version 4.1.x of the Hazard package. We are now using the autoconf package to automate the compile and install process. The steps are described in the INSTALL file in the root of the distribution. The basic steps are as follows:

  1. Decide where to install the executables. By default they will be installed in the /usr/local/hazard directory.
  2. Issue the ./configure command. If you want to move the installation directory, issue the command as configure --prefix=/install/directory/. An example install directory could be $HOME/hazard. The configure will build the make files required to compile the package. It will find required tools and environment to (hopefully) successfully build the system.
  3. Issue the make command to compile the code.
  4. Issue the make install command to completely install the package into your install directory.


If you have compiled the system on a platform besides Windows or Solaris, we would like to hear about your experiences. Please contact us at hazard@bio.ri.ccf.org. Pleas include the platform you are working on. If you would like to contribute a binary distribution kit, contact us for instructions on building the necessary files.

At this point, you can skip to the Hazard setup section.


A note about the Windows system is in order here. The Windows executables have been compiled from the same source code as the Unix versions. We accomplished this by using the CYGWIN tools. They are also freely available and can be downloaded from sources.redhat.com/cygwin. If you install the full distribution, you do not need to install any other tools. Once you install these tools, you can compile the sources into executables using the instructions given here.

The recommended installation directory under CYGWIN is c:\hazard. The configure command to install the program in this location is:

./configure --prefix=//c/hazard

Return to Top

Install the binary executables

Now that the programs have been compiled and linked into an executable form, you need to install the package.

If you compiled your own executable, the make install command completes this process. You can then proceed to the setup section.

From the Binary packages, follow the instructions for your specific platform.


You may need root access to complete the installation if you do not have permission to write to the installation directory.

Change to the parent of your installation directory and unpack the binary kit.
If you want the package installed in the hazard directory under your user home, cd to $HOME

Unpack the binary distribution.
Use the following command to unpack the distribution.

gzip -d < /path/to/distribution/hazard.PLATFORM.tar.gz | tar -xvf -


We use the winzip package to unzip windows distributions. It is available at winzip.

Once you've installed Winzip, the Windows link will automatically launch the winzip application. You must "extract" the files to your installation directory. Because of some incompatibilities, you must install this in a root directory, such as c:\ directory.

The distribution for any platform will create the hazard directory containing the standard hazard directory structure.

Return to Top

Setting up the system and SAS environments

The hazard package requires some environment variables to be set so that the macros that run the system know where to find the package directories. Different operating systems require different methods of setting these variables.

Windows Setup

  • Unix Setup
  • Windows Setup

    In Windows NT/2000/XP, From the Start menu choose Settings and Control Panels. Select the System control panel and go to the Advanced tab to set the Environment Variables....

    We added our the variables to the User variables for username " using the New... button in the upper section of the panel. If you have administration privilege, you could add them to the System variables so all users on the machine would not have to individually set their own environment.

    In Windows 9X/ME, edit the Autoexec.bat file on your System Disk, usually the C: drive. Add a line of the following form for each environment variable:

    set VARIABLE=value

    The following variables should be defined, they are case sensitive.

    VARIABLE Recommended Variable Value Description
    Hazard Environment variables for Windows platforms
    TMPDIR %TEMP% The location the Hazard package stores temporary files.
    HAZARD c:\hazard The root of the hazard installation
    HAZAPPS %HAZARD%\bin Executable files
    HZEXAMPLES %HAZARD%\examples Examples sas jobs and data sets
    MACROS %HAZARD%\macros Example SAS macros used by %HZEXAMPLE% files

    You may need to restart you machine for the environment to be correctly setup.

    You can now proceed to setting up your SAS environment.

    Unix Setup

    For Unix, the environment can be set in your startup files. If you are using ksh, bash or sh, use the export command from a .profile file.

    export VARIABLE=value

    for csh and it's variants use the setenv command in your .cshrc file

    setenv VARIABLE value

    If you need help setting these up correctly, contact your system administrator.

    VARIABLE Recommended Variable Value Description
    Hazard Environment variables for Unix platforms
    HAZARD /usr/local/hazard or
    The root of the hazard installation
    HAZAPPS $HAZARD/bin Executable files
    HZEXAMPLES $HAZARD/examples Examples sas jobs and data sets
    MACROS $HAZARD/macros Example SAS macros used by $HZEXAMPLE files

    SAS Setup

    Finally, you need to SAS where to find the hazard and hazpred macros. Our versions of SAS the config file is named sasv8.cfg, you should find a similar file for your release of SAS.


    On the unix platform, your personal version is located in your home directory ( ~/sasv?.cfg).


    On Windows, it is either in the c:\Program Files\Sas Institute\SAS\V8 directory or under your personal directory My Documents\My SAS Files\V8. The best way to find it is to do a search for sas*.cfg.

    Edit your config file, and find the sasautos command and add the HAZAPPS environment variable to it. The ! character tells SAS to interpret the following name as an environment variable in a platform independent manner:


    Our unix sasautos command look like this:

    -sasautos ( '!SASROOT8/sasautos' '!HAZAPPS')


    On the Windows platform:

      /* Setup the SAS System autocall library definition */


    On the Windows platform, add the following line to your sas config file

        /* Allow external commands to exit automatically */

    By default, SAS causes externally run programs to automatically open a DOS command window. The default behavior of the window requires you to type exit at the command prompt to close each window. The -noxwait command changes the behavior so that the window will close automatically.

    Return to Top

    Testing Hazard Installation

    The easiest way to test your Hazard installation is to run one of the Hazard example programs. Go to your !HZEXAMPLES directory and try running any/all of the example programs there. Documentation for the examples is located on the Examples page.

    Further documentation of the hazard system is available on our Documentation page.

    Return to Top

    Contact Information

    If you experience any difficulties with the installation or use of the HAZARD package, please contact us. The e-mail address is:


    Or, our daytime phone number is 216.444.6712. We would appreciate any feedback about your positive and negative experiences with the package, as well.

    Return to Top

    For questions or comments, please contact us at hazard@bio.ri.ccf.org