The code assumes that the data are all positive counts. You have zeros in your data, which is why it is giving an error.
You can get rid of the zeros in the data to see that the code works (replace them with 1).
The author of the code would be the best person to advise how to proceed. You can fix the problem by defining the WEIGHT module as follows, but I don't know if that change would preserve the behavior of the program.
START weight (X,Y);
k=ncol(X);
do i=1 to k;
s=X[1,i];
if s>0 then do;
z=repeat(i,1,s);
zz=zz||z;
end;
end;
zzz=t(zz);
Y=zzz;
FINISH weight;
... View more