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.
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.
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.
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.
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.
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.
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.
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.