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.
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.
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.
You can test your version of SAS by simply executing the SAS command.
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 from www.gnu.org.
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:
UNIX: 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.
Windows: 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
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.
UNIX: You may need root access to complete the installation if you do not have permission to write to the installation directory.
gzip -d < /path/to/distribution/hazard.PLATFORM.tar.gz | tar -xvf -
Windows: 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. We recommend placing them inthe c:\ directory.
The distribution for any platform will create the hazard directory containing the standard hazard directory structure.
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.
In Windows NT/2000, 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 hav administration privledge, 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 |
---|---|---|
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.
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 value | Description |
---|---|---|
HAZARD |
/usr/local/hazard or $HOME/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 |
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.
UNIX:On the unix platform, your personal version is located in your home directory (~/sasv?.cfg).
Windows: 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 seach 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:
UNIX: Our unix sasautos command look like this:
-sasautos ( '!SASROOT8/sasautos' '!HAZAPPS')
Windows: On the Windows platform:
/* Setup the SAS System autocall library definition */ -SET SASAUTOS ( "!sasroot\core\sasmacro" "!sasext0\graph\sasmacro" "!sasext0\stat\sasmacro" "!HAZAPPS" )
Windows: On the Windows platform, add the following line to your sas config file
/* Allow external commands to exit automatically */ -noxwait
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.
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.
If you experience any difficulties with the installation or use of the HAZARD package, please contact us. The e-mail address is:
hazard@bio.ri.ccf.orgOr, our daytime phone number is (216) 444-6712. We would appreciate any feedback about your positive and negative experiences with the package, as well.