|
Here is the code I received from David Matheson (SPSS Technical Support)
set mxloops = 10000.
loop sampnum = 1 to 10.
compute rannum = uniform(1).
xsave outfile = ='C:\spsssupp\ran_col_sort\ranrow.sav'
/ keep = sampnum scorea rannum.
end loop.
execute.
SAVE OUTFILE='C:\spsssupp\ran_col_sort\initial_data.sav'
/drop sampnum rannum
/COMPRESSED.
get file ='C:\spsssupp\ran_col_sort\ranrow.sav' .
rank rannum by sampnum / rank into ranrank .
formats ranrank sampnum (f8).
sort cases by ranrank sampnum .
match files /file = */drop = rannum.
CASESTOVARS
/ID = ranrank
/INDEX = sampnum
/GROUPBY = VARIABLE .
save outfile = ='C:\spsssupp\ran_col_sort\rancol10.sav' .
MATCH FILES
/FILE= 'c:\spsssupp\ran_col_sort\initial_data.sav'
/FILE= ='C:\spsssupp\ran_col_sort\rancol10.sav' .
EXECUTE.
save outfile = ='C:\spsssupp\ran_col_sort\rancol10_scorea.sav' .
|