data t;
if _N_=1 then do;
dcl hash hh(dataset:"m");
declare hiter iter('hh');
hh.definekey('x');
hh.definedata("x");
hh.definedone();
call missing(x);
end;
set test1;
iter.first();
do j=1 to x;
output;* or whatever you want here;
end;
do i=2 to hh.num_items;
iter.next();
do j=1 to x;
output;* or whatever you want here;
end;
end;
drop i j x;
run;