The answer then is no, not easily. If you have the if statements (and do avoid coding all in upper case), then you could write a code parser which would read in the text, work out where low and high values are, however there is nothing in the if statements to indicate what that group should be assigned to, i.e. we could write a code parser which from:
if missing(loantovalue) then do;
can find that missing values is one group, but what to assign to this group? So no, you can't do that. Also, writing the code parser would be far more work than just typing the proc format statement in.
What would be better is to go the other way. Create the format and use the format to select the if statement:
proc format;
value b_loantovalue
...;
run;
data want;
set have;
select(put(loantovalue,b_loadtovalue.));
when("Missing") do;
scorecard_points=sum(scorecard_points,21);
scr_loantovalue=21;
end;
when("Low -<0")...;
otherwise;
end;
run;
... View more