27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1342 RECORD TYPE<br />

Example<br />

* Reading only one record type from a mixed file.<br />

FILE TYPE MIXED RECORD=RECID 1-2.<br />

RECORD TYPE 23.<br />

DATA LIST /SEX 5 AGE 6-7 DOSAGE 8-10 RESULT 12.<br />

END FILE TYPE.<br />

BEGIN DATA<br />

21 145010 1<br />

22 257200 2<br />

25 235 250 2<br />

35 167 300 3<br />

24 125150 1<br />

23 272075 1<br />

21 149050 2<br />

25 134 035 3<br />

30 138 300 3<br />

32 229 500 3<br />

END DATA.<br />

• FILE TYPE begins the file definition, and END FILE TYPE indicates the end of file definition.<br />

FILE TYPE specifies a mixed file type. Since the data are included between BEGIN<br />

DATA—END DATA, the FILE subcommand is omitted. The record identification variable<br />

RECID is located in columns 1 and 2.<br />

• RECORD TYPE indicates that records with value 23 for variable RECID will be copied into<br />

the working data file. All other records are skipped. The program does not issue a warning<br />

when it skips records in mixed files.<br />

• DATA LIST defines variables on records with the value 23 for variable RECID.<br />

Example<br />

* Reading multiple record types from a mixed file.<br />

FILE TYPE MIXED FILE=TREATMNT RECORD=RECID 1-2.<br />

+ RECORD TYPE 21,22,23,24.<br />

+ DATA LIST /SEX 5 AGE 6-7 DOSAGE 8-10 RESULT 12.<br />

+ RECORD TYPE 25.<br />

+ DATA LIST /SEX 5 AGE 6-7 DOSAGE 10-12 RESULT 15.<br />

END FILE TYPE.<br />

• Variable DOSAGE is read from columns 8–10 for record types 21, 22, 23, and 24 and from<br />

columns 10–12 for record type 25. RESULT is read from column 12 for record types 21,<br />

22, 23, and 24 and from column 15 for record type 25.<br />

• The working data file contains values for all variables defined on the DATA LIST<br />

commands for record types 21 through 25. All other record types are skipped.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!