Submitting a SAS job on Abacus

Logging on to abacus
Log on to abacus using your standard logon procedure (for most people this will be via telnet to abacus.nodak.edu).

Creating a SAS program on abacus

  1. From the UNIX prompt (the $), type: pico prob1.sas (press return. Although sas does not require you to use the .sas extension, it is recommended you use this convention to help organize your SAS files.
  2. You should now be in the pico text editor. The cursor should be at the top of the screen. Key sequences are defined at the bottom of the screen. The carat preceding each key (e.g., ^O) refers to the control key. To save the contents of your file, hold down the control key and then press the letter O. To exit from the file (^X), hold down the control key and then press the letter X.
  3. Type in the contents of your file. Press the return key to start a new line. When you have filled all available lines on the screen, press return to get additional blank lines.

    Sample SAS Program
    DATA CLASS;
    INPUT NAME $ SEX $ AGE HEIGHT WEIGHT;
    CARDS;
    JOHN M 12 59.0 99.5
    ALFRED M 14 69.0 112.5
    LOUISE F 18 56.3 77.0
    PHIL M 16 72.0 150.0
    MARY F 15 66.5 112.0
    ROBERT M 12 64.8 128.0
    ;;;;
    PROC PRINT;
    PROC SORT; 
    BY SEX;
    PROC MEANS;
    BY SEX;
    PROC PLOT;
    PLOT WEIGHT*HEIGHT=SEX;
    

    If you wish to have your data in a separate file (e.g. survey.data) you would use the infile statement as follows:
    DATA CLASS;
    INFILE 'survey.data';
    INPUT ....

  4. When you have entered all of your program, press control O to save the file. Pico will then bring up a dialog box asking you to either confirm the name of the current file or to provide a new name for it. Press return to save the contents with the current name.
  5. To exit from your file back to the UNIX prompt at any time, hold down control and press X. Pico will bring up a dialog box asking you if you want to save the changes to the file (if there have been any). Simply respond by pressing the letter Y to save the changes or the letter N to discard the changes.
Running a SAS program on abacus
  1. To execute your SAS program, at the Unix $ prompt type: sas filename and press return. Note that you need not type the .sas extension in this command. If you do not follow the convention of the .sas extension, then you must type the entire name of the file containing the SAS statements.
  2. If you have made errors in your program, you will have to scan the saslog file to locate them. By default, the saslog file is given the extension .log on abacus. For example, for the program file prob1.sas the saslog file would be prob1.log
Viewing the output from a SAS program on abacus
  1. Executing a SAS program should also generate a second output file by default. This file will be named whatever the name of the program file is with the extension of .lst and will contain the results of the procedures.
  2. To see the output files created by SAS (as well as all other files in your current directory>, use the ls command. If you only want to see the output files, type: ls *.l* (press return). The asterisks are wildcards and refer to all other character combinations in the filename.
  3. Type: pico prob1.log (press return) to open the saslog file associated with prob1.sas. Use the control-V and control-Y key sequences to move forward and backward through the file, respectively. To search for a character string while editing the file, use the control-W command to bring up a dialog window where you can specify the string to locate (like ERROR).
  4. If you do not find any indications of trouble in the prob1.log file, exit from the file using control-X and return to the $ prompt.
  5. Type: pico prob1.lst (press return) to open the listing file associated with prob1.sas. This opens the prob1.lst file with the pico text editor. Again, use the control-V and control-Y key sequences to move forward and backward through the file, respectively. This file contains the output you are typically interested in.
  6. When you have finished scanning the prob1.lst file and want to return to the $ prompt, use control-X.
Correcting errors, re-running a SAS program on abacus
If you determine from your saslog that your program has errors, follow the steps below:
  1. Edit the original program (i.e., type: pico prob1.sas (press return)).
  2. Locate the errors in the file. Use the arrow keys to move the cursor to the location of the errors and type in the corrections.
  3. After entering all proposed corrections, save the file using control-O.
  4. Use the sas command (e.g. sas prob1) to execute the revised program.
  5. When the program execution has completed, edit the new saslog and scan for errors.
  6. If your program still has errors, repeat steps 1 through 5 until it becomes error-free.
Printing SAS output files on abacus
  1. Printed output will go to your default printer.
  2. At the Unix $ prompt type: pcprint filename and press return.

Handout prepared by: Information Technology Services (NDSU) - Spring 1996

Copyright 1996 North Dakota Higher Education Computer Network (HECN).
Written or electronic notification is requested for reproduction of this document. For information contact:
Documentation Coordinator
ND HECN Information Technology Services
North Dakota State University
P.O. Box 5164
Fargo, ND 58105
(701) 231-8685