SAS Examples

Instructor:  Joshua D. Naranjo
E-mail: joshua.naranjo@wmich.edu
Phone: (269)387-4548
Office: 5507 Everett Tower
How to Run SAS on Campus

  1. Go to a PC in a university computing lab (there are labs in Rood, Schneider, and Bernhard Center). Or get SAS for free on your windows laptop--bring a new 32 GIG flash drive to the OIT Help Desk (2nd floor of the UCC Building).
  2. Double click on the SAS icon on the desktop (or choose 'Programs' from Start menu). You will see a display that looks like the following. Notice tabs on the bottom for the Output, Editor, and Log windows.

  3. Click on the tab for the Log window. The Log window displays messages about your SAS session and any SAS programs that you submit.
  4. Click on the tab for the Output window. The Output window displays the LISTING output from SAS programs that you submit. It automatically moves to the front of your display when you create LISTING output.
  5. Click on the tab for the Editor window. You use this window to enter, edit, and submit SAS programs.
  6. Example: Cut-and-paste the SAS code below into the editor window and submit by clicking on the running-man icon on the top of the window. Then check out the contents of each of the Output, Editor, and Log windows.

    (If there is no output in the OUTPUT window, that means that this version of SAS has the default output in HTML format and is displayed in a Results window. To activate LISTING, go to the top of the main SAS window and choose Tools->Options->Preferences. Then check `Create Listing'.)

              DATA homes;                              
                     INPUT price sqft age;             
                     priceT=price/1000;                
                     DATALINES;
              205000 2650 13
              215000 2664  6
              215000 2921  3
              199900 2580  4
              190000 2580  4
              180000 2774  2
              156000 1920  1
              137500 1837  4
              127000 1880  8
              125000 2150 15
              123500 1894 14
              117000 1928 18
              ;                                        
              
              PROC PRINT DATA=homes;                  
              RUN;                   
    
              QUIT;
    
    
    

Some tutorials on SAS for Windows (For more, google 'SAS windows tutorial')

  • SAS manual documentation is available online.

    Go to (SAS Version 9 Online Documentation).
    Choose SAS/STAT.
    Choose SAS/STAT User's Guide.
    Scroll down to, for example, The REG Procedure.

  •  

    Department of Statistics
    3304 Everett Tower
    Western Michigan University
    Kalamazoo MI 49008-5152 USA
    (269) 387-1420 | (269) 387-1419 Fax
    stat-webmaster@wmich.edu