Using SAS on the server

Setting up to use SAS directly on the LINUX server

Getting into the Server

**If you have not installed the required server, goto Resources/Using the Server/Connecting to the Server (top menu) for setup instructions.

**If you will be using PC sas then you do not need to do this section.  This section is for those who will be using SAS directly on the LINUX server.

  1. Using the Terminal, type in “ssh (IP ADDRESS) -l (user name)”.
  2. Type in your password.

Using the Server

  1. Get familiar with a few commands (goto Resources/Linux/Commonly Used Linux Commands).  Remember in Linux, if you do not want to type in long commands and filenames, to try typing TAB.  It will complete the word you were typing if it can figure it out.
  2. Pick an editor you will learn (goto Resources/Linux/Editors in Linux). The rest of the lesson will use emacs
  3. Setup your workspace. That is setup the folder you will be working on this course in. (if you have not already done so type in the commands below)
    • cd HPM/usr
    • mkdir (your own directory name)
    • cd [This will get you back to your home directory, where you are when you first login]
  4. Use command “cd HPM/usr/(your own directory name)” to access your directory.

Using the Editor (Emacs)

  1. Use command “emacs” to open the editor.
  2. Use emacs command “ctrl + x + f” and type in “test.sas” to create a sas file.
    ** Note that “test.sas” is an example file. If you already have a file, then type in the specific file name that you want to open.
  3. Type in the sample code:data test;
    do var1=1 to 10;
    output;
    end;proc print data=test(obs=20);
  4. Use emacs command “ctrl + x + s” to save the file.
  5. Use emacs command “ctrl + x + c” to save and exit or “ctrl + z” to just exit file.
    ** Goto Emacs Reference Card for more emacs commands.

Running the Code

  1. Use command “sas test”, or “sas filename” if you used different filename.
    **This will create two files: the list file (test.lst) and the log file (test.log).
  2. Use command “more test.lst” to run the list file.
  3. Use command “more test.log” to run the log file.

Great Work! Now you are ready to learn SAS.