Hi:
I believe the problem is not with the IF statement, per se, but with understanding the difference between "execution-time" statements and "compile-time" statements. As explained in this documentation topic, the format statement is a "declarative" statement that only gets used by SAS one time in a program -- at compile time.
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a001225397.htm
Perhaps you meant to create the variable NAALR_BND from NAALR_SCR by using the PUT function with the appropriate format. Something like this:
[pre]
data table5;
set table4;
length naalr_bnd $10;
if bsnss_unt_id = 702 then do;
naalr_bnd=put(naalr_scr, naalrs.);
end;
else if bsnss_unt_id = 803 then do;
naalr_bnd= put(naalr_scr, naalra.);
end;
else do;
naalr_bnd = naalr_scr; /* this will be an unformatted value */
end;
run;
[/pre]
If you could possibly have more than 2 values for bsnss_unt_id, you might want to code a final ELSE condition.
cynthia