Generating random data(SPSS)

Hi ,

i want to generate non-returnable integer data from Chi-Square(2) distribution, using SPSS syntax .

I have some codes but i failed because i cant combine them. Is there any code for generating non-returnable data with SPSS ?

Anyway, how can i combine this codes ?


Chi-Square(2) code :

set mxloop=100.
compute n=50.
compute r=2.
compute d1=make(n,1,0).
compute d2=make(n,1,0).
compute  snormk=make(n,1,0).
compute kikare=make(n,1,0).
loop i=1 to r.
compute d1=uniform(n,1).
compute d2=uniform(n,1).
compute kikare=kikare+(sqrt(-2*ln(d1))&*sin(2*3.14*d2))&**2.
end loop.
compute sonuc={kikare}.
save sonuc / outfile=*.
end matrix.
Non-returnable 6 datas from [1-49] integer data

set mxloop=1000.
compute k=0.
compute a=1.
compute b=49.
compute usays=6.
compute torba={1:b}.
compute isay=make(usays,1,0).
loop i=1 to usays.
compute say=trunc((b-(i-1))*uniform(1,1))+1.
print say.
compute isay(i)=torba(say).
compute x=make(1,(b-i),0).
print isay(i).
loop j= 1 to b-(i-1).
do if (torba(j)<>isay(i)).
compute k=k+1.
compute x(k)=torba(j).
end if.
end loop.
print x.
compute torba=x.
compute k=0.
end loop.
print isay.
end matrix.