data temp(keep=x);
call streaminit(133);
do
i=1 to 1000;
x= ceil(rand('UNIFORM')*6);
output;
end;
run;
--------------------------------------------------------------
data out56(keep=NumRolls);
set temp;
retain count;
retain NumRolls(0);
if count =2
then NumRolls =0;
if x=5
then count=1;
else if (x=6 and count=1)
then count=count+1;
else count=0;