I feel like the practice exam must have been reviewed a thousand times for accuracy, so I feel silly asking this, but I really feel like the answer to Question 9 should be Bobby Bonilla. The question asks for the value of the NewName variable for observation 28 in the output data set:

The entire question is:
Write a SAS program that will:
-
Use PROC FCMP to create a user-defined function called ReverseName to convert the variable name values from lastname, firstname to firstname lastname (Example: convert Wei, Zhang to Zhang Wei) Store the function in work.functions.dev.
-
Use the following formula for the conversion:catx(" ", scan(name,2,","),scan(name,1,","))
-
Create a new data set work.ACT01.
-
Create this data set from the cert.names01 data set.
-
Use the ReverseName function to create a new variable newName from the name variable.
-
work.ACT01 should contain both the name and newName variables.
-
When finished, sort the new data set by the newName variable in ascending order.
The correct code is below and the names.01 dataset is attached here.
options cmplib=work.functions;
proc fcmp outlib=work.functions.dev;
function ReverseName(name $) $40;
return(catx(" ", scan(name,2,","),scan(name,1,",")));
endsub;
quit;
data work.act01;
set cert.names01;
newName=ReverseName(name);
run;
Can someone try this and let me know if I am missing something? The answer key states that the correct response is "Bo Diaz" but that is the value for observation 79.
Thanks!