To Lecture Notes

CSC 433 -- 4/11/16

Review Exercises

  1. How do you clear these windows: Enhanced Editor, Output Window, Log, Results Viewer.
    Ans: Enhanced Editor: Control-A, Delete;
    Output Window and Log: Right Click >> Edit >> Clear All;
    Results Viewer: Click in Results Viewer Window and in the main menu: Edit >> Clear All.
     
  2. How does the subsetting if statement work?
    Ans: The subsetting if statement looks like this:
    If gender = 'F' is true, the observation is kept in the dataset. If gender = 'F' is false, the observation is deleted.
     
  3. How can you convert a value from a numeric type to a character type and vice versa?
    Ans: Here are some examples.  Suppose that s = "123.45" and x = 123.45.
  4. How you handle embedded blanks in character values? Try out your solution on this file: states2.txt.
    Ans: Use an ampersand to tell SAS to keep reading a string with embedded blanks. Only stop reading the string if two consecutive blanks are encountered. For instance, here is a data step that does this:
  5. What is the SAS symbol for concatenation? for exponentiation?
    Ans: Ans: concatenation: ||   exponentiation: **
     
  6. What do these informats do?
    IB3. reads a 3 byte integer binary field.
    DATE. reads a date in ddmmmyy, where mmm is a three character month abbreviation, for example 04jul2013.
    ANYDTDTE. reads a time in various formats.
    JULIAN. reads a date in the format yyddd or yyyyddd, where ddd is the number of days since the beginning of the year.
     
  7. What does dsd mean in an infile statement?
    Ans: dsd means delimiter sensitive data.
     
  8. What is an encoding? List some popular encodings for SAS.
    Ans: An encoding is a method for representing characters in a file on disk. Popular SAS encodings are wlatin1, wlatin2, utf8, utf16-be (Big Endian), utf16-le (Little Endian).

 

D2L Quizzes

 

Special SAS Constants

 

Combining Datasets

 

Permanent SAS Datasets

 

Arrays

 

Project 3

 

SASHELP Datasets

 

SAS Graphics

 

Project 4

 

PROC GPLOT Scatterplots

 

GOPTIONS for SAS/GRAPH

 

The Iris Examples

 

More about Missing Values