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.
- Using the Terminal, type in “ssh (IP ADDRESS) -l (user name)”.
- Type in your password.
Using the Server
- 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.
- Pick an editor you will learn (goto Resources/Linux/Editors in Linux). The rest of the lesson will use emacs
- 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]
- Use command “cd HPM/usr/(your own directory name)” to access your directory.
Using the Editor (Emacs)
- Use command “emacs” to open the editor.
- 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. - Type in the sample code:data test;
do var1=1 to 10;
output;
end;proc print data=test(obs=20); - Use emacs command “ctrl + x + s” to save the file.
- 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
- 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). - Use command “more test.lst” to run the list file.
- Use command “more test.log” to run the log file.
Great Work! Now you are ready to learn SAS.