@sovrappensiero: The SQL part is simply building code for the data step that follows it.
proc sql noprint;
select catt(var,'=_',var),
catt(var,'=input(_',var,',8.);')
into :rens separated by ' ',
:vars separated by ' '
from owf
;
quit;
The first catt in the select section is building a space separated list to recode. I.e., given var1 and var2, e.g., it is creating:
var1=_var1 var2=_var2, and putting the result in a macro variable called &rens.
The second catt is building a set of statements that will take advantage of those recodes. i.e., given var1 and var2, e.g., it is creating var1=input(_var1,8.);
var2=input(_var2,8.);
and putting the result in a macro variable called called &vars.
The data step that follows simply uses the two macro variables as code to recode the variables and, for the latter, statements that will accomplish the actual conversion from character to numeric.
Art, CEO, AnalystFinder.com
... View more