Scenario 3

Directions

This scenario uses the Certadv.Airports and Certadv.Continent data sets. Write a SAS program that does the following:
  • Write a SAS DATA step that reads the Certadv.Airports data set and creates two temporary data sets named Work.Success and Work.Fail.
    • During the first iteration of the DATA step, load a hash object named C from the data set Certadv.Continent.
    • Use the numeric variable ID as the key component.
    • Use the character variable CtName as the data component.
    • Assign a length of 30 for the character variable CtName.
    • Set the initial value to missing to eliminate the uninitialized variable note.
  • In the DATA step, look up the value of ID variable from Certadv.Airports in the C hash object.
    • Retrieve the value of CtName from the hash object.
    • Create a variable named RC that contains a numeric value representing whether a match is found.
    • Store the results of successful lookups in the Work.Success data set.
    • Store the results of the unsuccessful lookups in the Work.Fail data set.

Test Your Code

  1. How many observations are in the Work.Success data set?
  2. How many observations are in the Work.Fail data set?

Exam Objective

Process data using hash objects.
Last updated: October 16, 2019
..................Content has been hidden....................

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