ORDERED Subcommand (FILE TYPE-END FILE TYPE command)
ORDERED
indicates
whether the records are in the same order as they are defined on the RECORD TYPE
commands. Regardless of the
order of the records in the data file and the specification on ORDERED
, the program builds cases in the
active dataset with records in the order defined on the RECORD TYPE
commands.
-
ORDERED
can be used only for grouped files. - The only specification is keyword
YES
orNO
. - If
YES
is in effect but the records are not in the order defined on theRECORD TYPE
commands, the program issues a warning for each record that is out of order. The program still uses these records to build cases.
YES. Records for each case are in the same order as they are defined on the RECORD TYPE commands. This is the default.
NO. Records are not in the same order within each case.
Example
* A grouped file with records out of order.
FILE TYPE GROUPED RECORD=#TEST 6 CASE=STUDENT 1-4 MISSING=NOWARN
ORDERED=NO.
RECORD TYPE 1.
DATA LIST /ENGLISH 8-9 (A).
RECORD TYPE 2.
DATA LIST /READING 8-10.
RECORD TYPE 3.
DATA LIST /MATH 8-10.
END FILE TYPE.
BEGIN DATA
0001 2 74
0001 1 B+
0002 3 71
0002 2 100
0002 1 A
0003 2 81
0004 2 94
0004 1 C
0004 3 91
END DATA.
- The first
RECORD TYPE
command specifies record type 1, the second specifies record type 2, and the third specifies record type 3. However, records for each case are not always ordered type 1, type 2, and type 3. -
NO
is specified onORDERED
. The program builds cases without issuing a warning that they are out of order in the data. - Regardless of whether
YES
orNO
is in effect forORDERED
, the program builds cases in the active dataset in the same order specified on theRECORD TYPE
commands.