Well, I see you guys have been busy overnight! For my 2p worth I would wrap in a tranwrd() to get the NA - I tend to avoid formats as much as possible.
data want;
length result $50;
infile datalines missover;
input obs name $ lifeex76;
result=tranwrd(catx("_",substr(name,1,3),put(lifeex76,best.)),".","NA");
datalines;
1 Algeria 55
2 Angola
;
run;
You could of course drop the put() statement, however then you would get notes in the log about number to char conversions - I would always put() personally as it is explicit what you are doing there. Remember coding is not so much about writing fantastically fast and complicated code, but making it simple for the next person to understand what you have coded.
... View more