data b;
input id $ num;
cards;
001 8
002 9
003 43
004 1000
;
run;
proc sort ;
by num;
run;
data ahuige(drop=num1 num2);
set b;
retain num1 num2 add;
do while (not (num1<=num<=num2) and (point+1<=&maxA)) ;
point+1;
set a point=point;
end;
if not (num1<=num<=num2 )then add='';
run;