You could use the INPUT function to convert the value returned by RESOLVE to numeric, like below example using sashelp.class:
%macro try(name=) ;
%local age ;
%let rc=%sysfunc(dosubl(%nrstr(
proc sql noprint ;
select age into :age
from sashelp.class
where name="&name"
;
quit;
))) ;
&age
%mend ;
proc sql ;
create table test2 as
select age
,case when input(resolve(cats('%try(name=' , name, ')' )),32.) > 12 then 'A' else 'B' end as foo
from sashelp.class
;
quit ;
But this will run very slowly, because DOSUBL is slow (it does a lot of work), and you are calling DOSUBL for every record in in your data.
I can't quite follow the logic of your code, but it would probably be possible to rewrite this as a pure SQL query, and avoid use of DOSUBL.
... View more