I need to restructure a data set and create cases; I couldn't work out >a syntax that works that displays data in another file > >My original data set has the following structure (varF and varM are >simply gender frequencies) >varAge varF varM >20 1 2 >21 0 0 >22 1 0 >23 1 1 >24 0 1 > >but should ideally look like >varID varAge varGender (F=0,M=1) >001 20 0 >002 20 1 >003 20 1 >004 22 0 >005 23 0 >006 23 1 >007 24 1 DATA LIST LIST /varAge varF varM. BEGIN DATA 20 1 2 21 0 0 22 1 0 23 1 1 24 0 1 END DATA. LOOP cnt=1 TO SUM(varF,varM). + COMPUTE vGender=(cnt > varF). + XSAVE OUTFILE='c:\\temp\\data.sav' /KEEP=varAge vGender. END LOOP. EXECUTE. GET FILE='c:\\temp\\data.sav' . COMPUTE varId=$CASENUM. FORMATS varID (N3). LIST varID varage vgender.. *The result is: VARID VARAGE VGENDER 001 20.00 .00 002 20.00 1.00 003 20.00 1.00 004 22.00 .00 005 23.00 .00 006 23.00 1.00 007 24.00 1.00 * Note: because the end value of cnt is given in the LOOP command, the syntax works even when SUM(varF,varM) > MXLOOPS value.