Chapter 12: Processing Data Using Hash Objects

  1. Correct Answer: b
    A SAS hash object exists only within the DATA step in which it creates the hash objects. When the DATA step ends, SAS deletes the hash object.
  2. Correct Answer: c
    Component objects are data elements that consist of attributes and methods. Attributes are the properties that specify the information while methods define the operations that an object can perform.
  3. Correct Answer: d
    There are three DEFINE methods that are required to define a hash object. The DEFINEKEY method defines the columns that make up the key component. The DEFINEDATA method defines the columns that make up the data component. The DEFINEDONE method indicates that all key and data components are complete.
  4. Correct Answer: b
    The FIND hash object method determines whether the key is stored in the hash object. The FIND method returns a value to indicate a found or not found key. You can use multiple FIND methods calls to retrieve multiple data values.
  5. Correct Answer: d
    The PREV method returns the previous value in the underlying hash object. This method can be used to iteratively transverse the hash object and return the data items in reverse key order.
  6. Correct Answer: b
    The CALL MISSING routine assigns a missing value to the specified character or numeric variables. Using the CALL MISSING routine helps you avoid receiving notes in the SAS log that your variables are uninitialized.
  7. Correct Answer: b
    The statement is false. You cannot define an iterator without also defining a hash object. The hash iterator is designed to work with a hash object.
  8. Correct Answer: a
    Answer a is correct because the code correctly associates two data values, City and Name, with one key, Code. The code also uses the three required methods correctly. Answer b defines two keys and one data value, while answer c defines two data and two keys. Answer d is invalid because it does not use the required methods properly.
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