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
* by Raynald Levesque.

DATA LIST LIST /id1 x1 x2 x3 x4 x5.
BEGIN DATA
1 2 . . 1 3
2 . . 2 4 5
3 1 2 3 . . 
END DATA.
LIST.

VECTOR x=x1 TO x5 /ind_x(5F8.0).
LOOP #cnt=1 TO 5.
COMPUTE x=x(#cnt).
   LOOP #cnt2=1 TO 5.
   DO IF #cnt=#cnt2. 
   COMPUTE ind_x(#cnt2)=~MISSING(x).
   ELSE.
   COMPUTE ind_x(#cnt2)=$SYSMIS.
   END IF.
END LOOP.

XSAVE OUTFILE='c:\\temp\\temp.sav' /KEEP id1 x ind_x1 TO ind_x5.
END LOOP.
EXECUTE.

GET FILE='c:\\temp\\temp.sav'.