* RAD, 6.26.2001; * http://www.devenezia.com * count the number of '1' bits in an integer; * * mod * 10.21.2009 fix for when x=0, thanks to Yevgen Yampolskiy; data _null_; do x= 0 to 512; nBitsOn = length(compress(put(x,binary32.),'0')) - (x=0); put x= x=BINARY32. nBitsOn=; end; run;