If there were decimals, then, not withstanding Doc's comments, something like this might help:
data have;
input sal $ 48.;
cards;
54498448949.49849
171.88
5454548978.754545415
2111.51
run;
data _null_;
set have end = eof;
retain int 0;
retain dec 0;
array digits(2);
digits(1) = scan(sal,1,'.');
digits(2) = scan(sal,2,'.');
if input(digits(1), 32.) gt int then int = digits(1);
if input(digits(2), 32.) gt dec then dec = digits(2);
if eof then do;
i = compress(int(log10(int))+1);
d = compress(int(log10(dec))+1);
t = compress(int(log10(int))+1 + int(log10(dec))+1 + 1) || '.' || compress(int(log10(dec))+1);
put 'NOTE: Integers: ' i ' Decimals: ' d ' suggested format: ' t;
end;
run;
Which gave me a message like this:
NOTE: Integers: 11 Decimals: 9 suggested format: 21.9