Thank you for your reply I ended up using the following but I will check proc rank as well: proc means data=&it04h mean min max; var dhi; output out=tmp min=mindhi max=maxdhi; run; data forbin; set tmp; bin=(maxdhi - mindhi)/100; drop i; retain fmtname 'bin' type 'n'; do i = 0 to 99; binstart = mindhi+(i*bin); binend = binstart + bin-0.01; label = cat(binstart," to ", binend); output; end; run; proc format cntlin=forbin (rename=(binstart=start binend=end)); run; proc freq data=&it04h; format dhi bin.; table dhi ; weight hpopwgt; run;
... View more