SAS labs II ( MATH 3080-002 ) Course Textbook Resources
Resources
SAS
SAS manual


Mac's  SSH:  Open a terminal and type:
ssh -Y userName@yourHostname

Sequence of keys
GEdit SAS editor
Ctrl-A   Ctrl-C Ctrl-T F3
Select All Copy Paste Submit

SAS Output Delivery System (ODS)

SAS ODS RTF Destination   ODS can also create HTML and TEX files.

SAS Online Resources for Students   New!!

Creating shortcuts to switch between workspaces on Solaris:
Launch -> Preferences -> Desktop Preferences 
-> Keyboard -> Shortcuts

Syllabus    Problems Assigned!

Datasets

Instruction to Labs

First Meeting: We went through the Sections 1, 2 and 3 from the resource's page. Optional Problems: 1.1 (Display time in seconds and Temp in Celsius (assuming it was in Fahrenheit) and 9.4 (cost vs days_lost).

Read Module 11. DocumentationDetailed Explanation.  

Read Module 20. Explanation.    Labels.    

●  Read module 15. Documentation.   Annotations.   

Read Module 16. Reg Procedure.   Annotations.

●  Read Module 17. 

Read Module 18.  Remember to plot y vs y_hat, studentized_residuals vs x1, x2..               Also we want to look at the probability plot of the residuals.

Read Module 19.     Documentation.     Mod19example.pdf

●  Read Module 21. Some additional annotated output can be found here.
         Related paper.
     Read Module 2 in order to recall the use of the subsetting if statement.
     To select more than one group with the where statement you can use the following:
                     where var1 = value1 and var2 = value2;
      Remember that you have HW and project assigned for the course
       Questionnaire.

●  Read Module 25. Hint: Use the ttest procedure and the boxplot procedure exaplianed in modules 5 and 11 of the third version. Look for warnings!, if the SAS-log tells you to sort an specific variable then have it done in your macros.

●  Read Module 12.     Demonstrartion.

●  Read Module 13.      Demonstrartion.

●  Read Module 14.    Demonstrartion.

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 Wheel Paste
  • 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="~/";
/**code**/
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