From a practice exam:
-----------
The dataset Cars contains observations listing hte Make, Model and Country of Origin of 300+ vehicles. Consider the SAS code below:
data_null_;
attrib Make length=$15 Label="Make Name";
declare hash Makelist(dataest:'cars', ordered:'yes');
Makelist.definekey('Make');
Makelist.definedone();
rc=Makelist.output(dataset: 'Manufacturer');
run;
What is the result of running this program?
A) The manufacturer dataset contains unique values of Make in ascending order
B) The manufacturer Dataset contains unique values of Make in the original order as the input data.
C) The manufacturer Dataset contains a copy of the Cars dataset in order
D) The manufacturer Dataset contains a single observation as the data step iterates only once.
I answered C but the correct answer is A. Does this then mean that the definekey statement enforces uniqueness on those variable values, similarly to the PRIMARY KEY constraint?