GET FILE = 'Hierarchy Table.sav'. SORT CASES BY a09. SAVE OUTFILE = 'Hierarchy Table.sav'.
Get file = 'Tri File xxxx/xx.sav'.
SORT CASES by A09. MATCH FILES /FILE=* /TABLE='Hierarchy Table.sav' /BY A09. RECODE A28 (0=SYSMIS) (ELSE=COPY).
If mapcode = (" ")mapcode = A09.
compute startyr = 0.
Do if (A27 >= date.dmy( 1, 8, 99 ) and A27 <= date.dmy( 31, 7, 2000)). compute startyr=1999.
else if (A27 >= date.dmy( 1, 8,2000 ) and A27 <= date.dmy( 31, 7, 2001)). compute startyr=2000.
else if (A27 >= date.dmy( 1, 8,2001 ) and A27 <= date.dmy( 31, 7, 2002)). compute startyr=2001.
else if (A27 >= date.dmy( 1, 8,2002 ) and A27 <= date.dmy( 31, 7, 2003)). compute startyr=2002.
else if (A27 >= date.dmy( 1, 8,2003 ) and A27 <= date.dmy( 31, 7, 2004)). compute startyr=2003.
else if (A27 >= date.dmy( 1, 8,2004 ) and A27 <= date.dmy( 31, 7, 2005)). compute startyr=2004.
end if.
compute actendyr = 0.
Do if (A31 >= date.dmy( 1, 8, 2002 ) and A31 <= date.dmy(31, 7, 2003)). compute actendyr=2002.
else if (A31 >= date.dmy( 1, 8, 2003 ) and A31 <= date.dmy(31, 7, 2004)). compute actendyr=2003.
else if (A31 >= date.dmy( 1, 8, 2004 ) and A31 <= date.dmy(31, 7, 2005)). compute actendyr=2004.
else if (A31 >= date.dmy( 1, 8, 2005 ) and A31 <= date.dmy(31, 7, 2006)). compute actendyr=2005.
else if (A31 >= date.dmy( 1, 8, 2006) and A31 <= date.dmy(31, 7, 2007)). compute actendyr=2006.
else if (A31 >= date.dmy( 1, 8, 2007) and A31 <= date.dmy(31, 7, 2008)). compute actendyr=2007. end if. Execute.
compute expendyr = startyr.
Do if (A28 >= date.dmy( 1, 8, 2002 ) and A28 <= date.dmy( 31, 7, 2003)). compute expendyr=2002.
else if (A28 >= date.dmy( 1, 8, 2003 ) and A28 <= date.dmy( 31, 7, 2004)). compute expendyr=2003.
else if (A28 >= date.dmy( 1, 8, 2004 ) and A28 <= date.dmy( 31, 7, 2005)). compute expendyr=2004.
else if (A28 >= date.dmy( 1, 8, 2005 ) and A28 <= date.dmy( 31, 7, 2006)). compute expendyr=2005.
else if (A28 >= date.dmy( 1, 8, 2006 ) and A28 <= date.dmy( 31, 7, 2007)). compute expendyr=2006.
else if (A28 >= date.dmy( 1, 8, 2007 ) and A28 <= date.dmy( 31, 7, 2008)). compute expendyr=2007.
else if (A28>=date.dmy(1,8,2008)). compute expendyr=2008. end if.
value labels startyr, actendyr, expendyr 1997 '1997-98' 1998 '1998-99' 1999 '1999-2000' 2000 '2000-2001' 2001 '2001-2002' 2002 '2002-2003' 2003 '2003-2004' 2004 '2004-2005' 2005 '2005-2006' 2006 '2006-2007' 2007 '2007-2008' 0 'missing actual'. Execute.
Select if A46A<>1. Select if A46B<>1.
SORT CASES by newref, mapcode, startyr, expendyr. SAVE OUTFILE = 'Tri_File xxxx/xx.sav'.
Get file ='Tri_file 2002/03.sav'. Compute F050203=0. If (startyr=2002 and expendyr=2003 and A34=1) F050203 =1. Save outfile ='Tri_file 2002/03.sav'.
Get file = 'Tri_file 2003/04.sav'. Compute F050304=0. If (startyr=2002 and expendyr=2003) F050304=1. Save outfile='Tri_file 2003/04.sav'.
|