Scenario 8

Directions

This scenario uses the Cert.Addresses data set. Write a SAS program to do the following:
  • Create a temporary SAS data set that uses Cert.Addresses and store the results in Work.Scenario8.
  • Extract the 5-digit ZIP codes from the State variable and store them in the ZipCode variable.
  • Extract the two letters from the State variable and store them in the State variable.
  • Create a one-way frequency table using the variable State.

Test Your Code

  1. What is the frequency for the state of NY?
  2. Which observation contains ZipCode 85069?
  3. How many states have the frequency number of 4?

Objectives Accomplished

  • Use a DATA step to create a SAS data set from an existing SAS data set.
  • Use assignment statements to create new variables and assign a value in the DATA step.
  • Use SAS functions such as SUBSTR to search a character value and extract a portion of the value.
  • Generate frequency tables using Base SAS procedures.
Last updated: February 14, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset