Reading a Subset of Records in a Mixed File
You may want to process a subset of records in a mixed file. The following commands read only the data for the student who took reading tests:
FILE TYPE MIXED RECORD=TEST 1-7(A).
RECORD TYPE 'READING'.
DATA LIST / ID 9-10
GRADE 12-13
WORD 15-16
COMPRE 18-19.
RECORD TYPE 'WRITING'.
DATA LIST / ID 9-10
GRADE 12-13
HANDWRIT 15-16
SPELLING 18-19
VOCAB 21-22
GRAMMAR 24-25.
END FILE TYPE.
BEGIN DATA
READING 1 04 65 35
WRITING 2 03 50 55 30 25
END DATA.
LIST.
-
FILE TYPE
specifies that data contain mixed record types.RECORD
defines the record identification variable as TEST in columns 1 through 7. -
RECORD TYPE
defines variables on reading records. Since the program skips all record types that are not defined by default, the case with writing scores is not read. -
END FILE TYPE
signals the end of file definition. -
BEGIN DATA
andEND DATA
indicate that data are inline. Data are identical to those in the previous example. - The following figure shows the output from
LIST
.
TEST ID GRADE WORD COMPRE
READING 1 4 65 35