SAS for Unix

Connecting to HAWK

In order to run SAS you must first connect to Hawk. If you are dialing in you will need to use one of the DePaul phone numbers in the modem pool. You may then use your communications software to dial in.

Using Unix

If you have general questions about Unix try the Unix at DePaul page.

SAS for Unix - GUI

SAS for Unix supports a GUI interface. However, to use a GUI you will need to install X-Windows Terminal Emulator software on your PC. Several such products exist, many of which are shareware, or are available at a nominal price. The best source for this software is tucows.com. Do a search for x-windows and you will find several products. The MI/X X Server product offered by MicroImages works well and is recommended.

Once the product is installed, it is merely a matter of launching MI/X, settting the DISPLAY environment variable on the remote host (i.e. hawk) to the IP address of your PC, and executing sas at the command line without arguments (i.e. hawk% sas). After a few seconds the SAS GUI will be available on the MI/X desktop and you will be able to use SAS for Unix in essentially the same way as you use SAS for Windows.
Note: You should only attempt this if you are familiar with Unix. Although the MI/X product comes with a good FAQ, it assumes some knowledge of Unix.

SAS for Unix in Batch Mode

In batch mode, SAS commands or statements are executed from one file, with the file extension .sas, and output directed to two other files with the same name as the input file, but with the file extensions .log and .lst. The SAS Log (.log) file contains notes and messages produced by the program, and the SAS Listing (.lst) file contains output from SAS procedures that produce printed results.

To run in batch mode, first create a file of SAS statements called a program, with a UNIX editor (e.g. vi). SAS statements are free format but must end with a semicolon (;).

Running SAS in Batch

After creating a program, you can run it by typing sas filename.sas at the UNIX prompt (where "filename.sas" is the name of your SAS program file). Note that .sas is in lowercase letters. Including the .sas extension when running your program is optional.

Output in Batch Mode

Output from SAS procedures will appear in your .lst file, which can be viewed by typing the UNIX command more filename.lst. The more command will scroll a screen at a time of your output. At the bottom of the screen you will notice --More--(nn%) indicating that there is more to be viewed and that you have viewed nn% of your file. By hitting the space bar another screen of output will be scrolled. Note that you may also bring the file into an editor (see SAS in Batch Mode) to view the contents. This allows you to use the full set of search and navigation aids provided by your editor. If there is a problem with your program, bring it back into your editor, make corrections, save it, and run SAS again.

NOTE: SAS does not display warning or error messages on your screen as it runs, but sends them to the .log file. Do not assume your program ran correctly just because no messages appeared on the screen. Check your .log file for error messages by typing more filename.log, or by bringing the file into an editor and searching for the string ERROR.

Printing Output Files

If you have dialed into hawk, you should first download your .lst file and import it into a wordprocessor. Make sure to change your font to Courier before printing.

You may also use the UNIX print command to send files to the printer. Note however that in this case your file can only be printed at one of the labs. Following is the transcript of a session on hawk which prints "guide1.sas" at the Oakbrook (i.e. "oak") lab and indicates to the operator that you want your input placed in bin "10".

hawk% print
Enter filenames to be printed : guide1.sas
Enter location (ac,ssc,lpc,nwc,oak): ac
Enter bin number (1-150) : 10
request id is ac-1479 (1 file(s))
hawk%

SAS File Name Conventions

Programs: You can use any name for the file of SAS program statements, but the file extension should be .sas (e.g., guide1.sas or gss91a.sas).

Raw Input/Output: Any UNIX path name plus a file name enclosed in quotes can be used on the SAS infile statement. See examples below:
bulletinfile 'test.dat';
bulletinfile '~/data/wk12.dat';
bulletinfile '/condor/datasets/csc323/cdrom.samp';