Restructure data fileexample3
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 | *** An example of data restructure. *** rlevesque@videotron.ca. * Create a data file for illustration purposes. DATA LIST FREE /v1. BEGIN DATA. 1 2 3 4 5 6 7 8 9 10 END DATA. LIST. DO REPEAT V=V2 TO V105. COMPUTE v=TRUNC(UNIFORM(1)*10). END REPEAT. EXECUTE. LIST. * Do the job. VECTOR v=v1 TO v105. LOOP #cnt=10 TO 102 BY 4. COMPUTE a1=v(#cnt). COMPUTE a2=v(#cnt+1). COMPUTE a3=v(#cnt+2). COMPUTE a4=v(#cnt+3). XSAVE OUTFILE='c:\\temp\\lp_1_25.sav' /KEEP v1 TO v9 a1 TO a4. END LOOP. EXECUTE. GET FILE='c:\\temp\\lp_1_25.sav'. |
Related pages
...