SAS labs (MATH 3070, 3170) Course Textbook Resources
SAS manual

SAS Output Delivery System (ODS)   

VNC Instructions  

Mac'S  SSH:  Open a terminal and type:
ssh -Y userName@yourHostname 
Sequence of keys
GEditSAS editor
Ctrl-A  Ctrl-CCtrl-TF3
Select AllCopyPasteSubmit

Creating shortcuts to switch between workspaces on Solaris:

Launch -> Preferences -> Desktop Preferences
-> Keyboard -> Shortcuts


Datasets             Comparison between Operating Systems

Instruction to Labs     

Read Module 1. Example.             Questionnaire-1

Read Module 2.  Demonstration.      Delimiter_example.
                           URL_import_example.  Apply the xxu and dos2ux commands.

Read Module 3. Demonstration.

Read Module 4. Demonstration.

Read module 5. Annotations.     Demonstration.  
Read module 6.     Demonstration.    

Read Module 7.     Demonstration.        
       Notice on problem 7.4 that you need to use the 'by' statement on the golfer variable. Column input is not required but encouraged.


Read Module 8.    Demonstration.  

Read Module 9.    Demonstration.     

Read Module 10.  Demonstration.

Assignment 11 posted.

SAS editor shortcuts Hints and/or common mistakes Other SAS statements
F2 Keys
F3 Submit
F4 Recall
Ctrl E Clear
Ctrl N Undo
Ctrl T Paste
END Submit
Scroll wheelPaste
  • Make sure you are in the right working directory, you can always change the working directory by going to
    Tools -> Options -> Change Directory...
  • Variables names should start with a character, they can contain numbers and underscores, but no dots nor spaces nor dashes.
  • If SAS is not reading your input, use column input (page 8) or formatted input (page 9)
  • Always check the dataset and read its full description given on the appendix of the book. 
  • If after constantly trying, your program still doesn't compile, you will have to carefully check that every statement is being spelled correctly, check that every variable name is being correctly re-written. If you still have problems, save your code, restart SAS and then run your code again.
options nocenter; left justifies the output
 ods pdf file="~/";
ods pdf close;
Creates a pdf from the output
 endsas; Exits SAS
 x**(y) raises x to the power y


Useful Terminal Commands
>ls lists the contents of your current working directory.
>cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree.
>pwd print working directory
>man command There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behavior of the command. Type man command to read the manual page for a particular command.
The * wildcard

The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. 

>kill %jobnumber To kill a specific job number displayed in brackets '[]'.
>kill PID_number

Alternatively, processes can be killed by finding their process numbers (PIDs) and using kill PID_number.

>exit Exits the terminal.
>dos2ux filelist Converts text files from DOS format to UNIX format.
>xxu filelist Lowercases filenames and strips spurious pathnames from them.

Correcting the formatting of the datafiles
Solaris is a UNIX-based operating system. It is natural that SAS will request the data in its base operating system. The datasets downloaded are in DOS (Microsoft) format. To convert the datasets into the unix format follow these instructions:
  1. Open a terminal
  2. Set your directory to the datasets folder. In my case, I saved the files under a folder called 'Datasets' under the Desktop main folder.
    >cd Desktop/Datasets
    Now I am under the Datasets directory
  3. Run the dos2ux command that will make the conversion to all of your datasets:
    >dos2ux *.dat
    The *.dat is a list of all your files that begins with any string of characters and finishes with the extension .dat. After executing this specific command, all your .dat files will be converted into unix format. The terminal will display when the conversion finishes successfully.
  4. Finally, run the xxu command to all the files on your datasets folder, to make sure that all of them will start with a lowercase letter:
    >xxu *.dat