array _p{1:20} p1-p20;
retain p1-p20;
retain j j1 j2 id 0;
id=1; _n=1;
do until (eof);
set x end=eof nobs=ntotal;
if _n=1 then do;
j=round(ntotal/20); j1=round((ntotal-j*18)/2); j2=ntotal-j*18-j1;
_p[1]=j1;
do _i=2 to 19;
_p[_i]=j1+(_i-1)*j;
end;
_p[20]=ntotal;
put j= j1= j2= //;
put _p[*]=;
end;
rc=h.add();
id+1;
_x=whichN(_n, of _p[*]);
if _x>0 then do;
put _n= _x=;
rc=h.output(dataset:compress('j'||_x));
rc=h.delete();
id=1;
%hashinit;
end;
_n+1;
end;
run;