A SAS programmer is building a scoring pipeline in DS2. Which statement correctly defines a DS2 package method signature for a scoring function that takes two numeric inputs and returns a numeric prediction?
Select an answer to reveal the explanation.
Short Explanation
Here's the deal — you need the METHOD keyword with each parameter labeled IN or OUT and typed as DOUBLE. That's how DS2 defines a scoring method that takes two numeric inputs and returns a numeric prediction.
Full Explanation
METHOD score(IN DOUBLE x1, IN DOUBLE x2, OUT DOUBLE pred); END; is correct because in DS2, SAS's modern data programming language, a method signature uses the METHOD keyword followed by the method name and a parameter list where each parameter specifies direction (IN/OUT), type (DOUBLE for numeric), and name. The FUNCTION score(x1, x2) RETURNS pred; option uses SAS macro function syntax, not DS2. The PROC score; INPUT x1 x2; OUTPUT pred; RUN; option uses PROC step syntax, not DS2 method syntax. The DS2 METHOD score INPUT=(x1 x2) OUTPUT=(pred); option is fabricated syntax that does not exist in DS2.