To Lecture Notes

CSC 433 -- Apr 3, 2017

Review Questions

  1. What are some useful windows in the SAS 9.4 IDE?
    Ans: Enhanced Editor, Results Viewer (HTML output), Output Window (typewriter output), Log (shows what SAS did and any error messages), Explorer (Excel-like spreadsheet that shows data libraries and current dataasets), Results Window (table of contents of SAS output).
     
  2. What are some items that you can specify in an options statement?
    Ans: Here is an example options statement:
  3. Give four ways to specify the column for reading the next item in an input statement.
    Ans: m-n (read columns m to n)
           @n (move column pointer to column n)
           +n (move column pointer n columns to the right)
           @"GET" (move the column pointer past the string "GET")
     
  4. Write a SAS script to verify that Jan 1, 1960 is the SAS zero date.
     
  5. What is the difference between these informats?
    Write a SAS test script to verify your answer.
    Ans: The second informat uses the colon modifier, which stops reading when a space is encountered. Write a test script to verify the difference between these two informats. Ans:
    With the colon modifier :$10. stops the input when it reaches a space.
     
  6. What is the output?
    When x is read with the informat 3., three digits are read.
    When y is read with 8.3, there is an embedded decimal point, so, starting with 6, 8 characters are read: 678.9012; this value is then rounded to 3 digit after the decimal.
    When z is read, there is no embedded decimal point, so 9 digits are read: 345678901. Then a decimal point is positioned so that there are two digits to the right of the decimal point.
     
  7. Explain the difference between @ and @@. Write a SAS script to verify your answer.
    Ans: @ means hold the input line until the end of the data step.
    @@ means hold the input line until the data in the line are all used.
     
  8. How do you display labels as column headers in proc print output?
    Ans: Use the label option:

 

D2L Quiz 1

 

Computing New Variables

 

User Defined Formats

 

Comma Delimited Files

 

Reading Binary Data

 

The set and Subsetting if Statements

 

Conditions that Cause Dataset Execution to Terminate

 

Causing Variables to Persist across Observations

 

Writing to a File

 

Project 1

 

Executable vs. Declarative Statements

 

Encodings

 

SAS Functions

 

Project 2

 

Control Statements