The PROC SORT step in SAS is used to sort data sets by one or more variables. The syntax for the proc sort step requires the by statement to specify the variable(s) by which to sort the data. The correct answer is option A:
proc sort data=Names;
by Name;
run;
This sorts the data set by the variable 'Name' in alphabetical order, which matches the sorted NAMES data set shown in the question. Option B uses orderby, which is not a valid SAS statement. Option C sorts by 'Age', which would not give the same result as shown in the question. Option D also incorrectly uses orderby.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit