Leave Period Sample Code
Note: This page is from an older version of the Data Dictionary and may therefore contain information that is now out of date. It is included here for reference only.
1 The following pseudo code and SPSS code is provided to illustrate the Leave Period data definition.
A_LEAVEP
2 The following table shows the steps required to derive A_LEAVEP.
Step | Condition | Action if true | Action if false |
1 | Is A31< 1 Aug Relevant Academic year | Set A_LEAVEP to -99 | Go to 2 |
2 | Is A31<= 31 Jul Relevant Academic year + 1 | Go to 3 | Go to 15 |
3 | Is the month of A31 = Aug | Set A_ LEAVEP to 1 | Go to 4 |
4 | Is the month of A31 = Sep | Set A_ LEAVEP to 2 | Go to 5 |
5 | Is the month of A31 = Oct | Set A_ LEAVEP to 3 | Go to 6 |
6 | Is the month of A31 = Nov | Set A_ LEAVEP to 4 | Go to 7 |
7 | Is the month of A31 = Dec | Set A_ LEAVEP to 5 | Go to 8 |
8 | Is the month of A31 = Jan | Set A_ LEAVEP to 6 | Go to 9 |
9 | Is the month of A31 = Feb | Set A_ LEAVEP to 7 | Go to 10 |
10 | Is the month of A31 = Mar | Set A_ LEAVEP to 8 | Go to 11 |
11 | Is the month of A31 = Apr | Set A_ LEAVEP to 9 | Go to 12 |
12 | Is the month of A31 = May | Set A_ LEAVEP to 10 | Go to 13 |
13 | Is the month of A31 = Jun | Set A_ LEAVEP to 11 | Go to 14 |
14 | Is the month of A31 = Jul | Set A_ LEAVEP to 12 | Go to 15 |
15 | Else | Set A_ LEAVEP to 99 | |
3 The following SPSS code illustrates how to derive A_LEAVEP
GET FILE=’……….Aims dataset’.
DO IF XDATE.YEAR(A31)=relevant academic year. IF XDATE.MON(A31)=8 A_LEAVEP=1. IF XDATE.MON(A31)=9 A_LEAVEP=2. IF XDATE.MON(A31)=10 A_LEAVEP=3. IF XDATE.MON(A31)=11 A_LEAVEP=4. IF XDATE.MON(A31)=12 A_LEAVEP=5. ELSE IF XDATE.YEAR(A31)=relevant academic year+1. IF XDATE.MON(A31)=1 A_LEAVEP=6. IF XDATE.MON(A31)=2 A_LEAVEP=7. IF XDATE.MON(A31)=3 A_LEAVEP=8. IF XDATE.MON(A31)=4 A_LEAVEP=9. IF XDATE.MON(A31)=5 A_LEAVEP=10. IF XDATE.MON(A31)=6 A_LEAVEP=11. IF XDATE.MON(A31)=7 A_LEAVEP=12. END IF.
VARIABLE LABELS A_LEAVEP "DV - Period Left in" VALUE LABELS A_LEAVEP -99 "Before 1 August relevant academic year" 1 "Period 1" 2 "Period 2" 3 "Period 3" 4 "Period 4" 5 "Period 5" 6 "Period 6" 7 "Period 7" 8 "Period 8" 9 "Period 9" 10 "Period 10" 11 "Period 11" 12 "Period 12" 99 "Continuing". |
E_LEAVEP
4 The following table shows the steps required to derive E_LEAVEP.
Step | Condition | Action if true | Action if false |
1 | Is E10>= 1 Aug Relevant Academic year | Set E_LEAVEP to -99 | Go to 2 |
2 | Is E10<= 31 Jul Relevant Academic year + 1 | Go to 3 | Go to 15 |
3 | Is the month of E10 = Aug | Set E_LEAVEP to 1 | Go to 4 |
4 | Is the month of E10 = Sep | Set E_LEAVEP to 2 | Go to 5 |
5 | Is the month of E10 = Oct | Set E_LEAVEP to 3 | Go to 6 |
6 | Is the month of E10 = Nov | Set E_LEAVEP to 4 | Go to 7 |
7 | Is the month of E10 = Dec | Set E_LEAVEP to 5 | Go to 8 |
8 | Is the month of E10 = Jan | Set E_LEAVEP to 6 | Go to 9 |
9 | Is the month of E10 = Feb | Set E_LEAVEP to 7 | Go to 10 |
10 | Is the month of E10 = Mar | Set E_LEAVEP to 8 | Go to 11 |
11 | Is the month of E10 = Apr | Set E_LEAVEP to 9 | Go to 12 |
12 | Is the month of E10 = May | Set E_LEAVEP to 10 | Go to 13 |
13 | Is the month of E10 = Jun | Set E_LEAVEP to 11 | Go to 14 |
14 | Is the month of E10 = Jul | Set E_LEAVEP to 12 | Go to 15 |
15 | Else | Set E_LEAVEP to 99 | |
5 The following SPSS code illustrates how to derive E_LEAVEP
GET FILE=’……….Aims dataset’. DO IF XDATE.YEAR(E10)=relevant academic year. IF XDATE.MON(E10)=8 E_LEAVEP=1. IF XDATE.MON(E10)=9 E_LEAVEP=2. IF XDATE.MON(E10)=10 E_LEAVEP=3. IF XDATE.MON(E10)=11 E_LEAVEP=4. IF XDATE.MON(E10)=12 E_LEAVEP=5. ELSE IF XDATE.YEAR(E10)=relevant academic year+1. IF XDATE.MON(E10)=1 E_LEAVEP=6. IF XDATE.MON(E10)=2 E_LEAVEP=7. IF XDATE.MON(E10)=3 E_LEAVEP=8. IF XDATE.MON(E10)=4 E_LEAVEP=9. IF XDATE.MON(E10)=5 E_LEAVEP=10. IF XDATE.MON(E10)=6 E_LEAVEP=11. IF XDATE.MON(E10)=7 E_LEAVEP=12. END IF.
VARIABLE LABELS E_LEAVEP "DV - Period Left in" VALUE LABELS E_LEAVEP -99 "Before 1 August relevant academic year" 1 "Period 1" 2 "Period 2" 3 "Period 3" 4 "Period 4" 5 "Period 5" 6 "Period 6" 7 "Period 7" 8 "Period 8" 9 "Period 9" 10 "Period 10" 11 "Period 11" 12 "Period 12" 99 "Continuing". |
Last Modified: 29 Sep 06