A SAS programmer needs to pass a dynamic list of variables to a macro that builds a model. Which SAS macro technique allows iterating over a space-delimited list of variable names?
Select an answer to reveal the explanation.
Short Explanation
You need to loop through each token in a space-delimited macro variable list, and %DO %WHILE with %SCAN does exactly that. It pulls one variable name at a time until the list is exhausted.
Full Explanation
The %DO %WHILE loop with %SCAN function is correct because %DO %WHILE combined with %SCAN(&list, &i, ' ') iterates through each token in a space-delimited macro variable list, which is the idiomatic SAS approach for passing a dynamic list of variable names into a macro. PROC CONTENTS with OUT= option retrieves metadata but does not provide iteration logic. CALL SYMPUTX inside a DATA step to create a single macro variable stores a value in one macro variable but does not handle iteration over a list. %LET with a comma-delimited list passed to PROC HPLOGISTIC is wrong because PROC HPLOGISTIC does not natively parse comma-delimited macro variable lists for variable names.