1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
*** This is an example of restructuing data.
*** rlevesque@videotron.ca.

**** This section creates dummy data for illustration purposes.
DATA LIST LIST /subject.
BEGIN DATA.
1 
2
3
END DATA.
LIST.

LOOP #cnt=1 TO 9.
	COMPUTE cond=#cnt.
	XSAVE OUTFILE='temp.sav' /KEEP subject cond.
END LOOP.
EXECUTE.
GET FILE='temp.sav'.
LIST.

VECTOR dv(10F8.1).
SET SEED=13254769.
LOOP #cnt=1 TO 10.
COMPUTE dv(#cnt)=UNIFORM(10).
END LOOP.
EXECUTE.

**** This section does the job.
DO REPEAT v=dv1 TO dv10.
VECTOR v(9F8.1).
COMPUTE v(cond)=v.
END REPEAT.

AGGREGATE
  /OUTFILE=*
  /BREAK=subject
  /dv1_1 TO dv1_9 dv2_1 TO dv2_9 dv3_1 TO dv3_9 dv4_1 TO dv4_9= MAX(dv11 TO dv49)
  /dv5_1 TO dv5_9 dv6_1 TO dv6_9 dv7_1 TO dv7_9 dv8_1 TO dv8_9= MAX(dv51 TO dv89)
  /dv9_1 TO dv9_9 = MAX(dv91 TO dv99).