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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FILE TYPE—END FILE TYPE 575<br />

• The column location of the case identifier is required. The variable name is optional.<br />

• If you do not want to save the case identification variable, you can assign a scratch variable<br />

name by using the # character as the first character of the name. If a variable name<br />

is not specified on CASE, the case identifier is defined as the scratch variable ####CASE.<br />

• A column-style format can be specified for the case identifier. For example, the following<br />

two specifications are valid:<br />

CASE=V1 1-2(N)<br />

CASE=V1 1-2(F,1)<br />

FORTRAN-like formats cannot be used because the column location must be specified<br />

explicitly.<br />

• Specify A in parentheses after the column location to define the case identification variable<br />

as a string variable.<br />

• If the case identification number is not in the same columns on all record types, use the<br />

CASE subcommand on the RECORD TYPE commands as well as on the FILE TYPE<br />

command (see RECORD TYPE).<br />

Example<br />

* A grouped file of student test scores.<br />

FILE TYPE GROUPED RECORD=#TEST 6 CASE=STUDENT 1-4.<br />

RECORD TYPE 1.<br />

DATA LIST /ENGLISH 8-9 (A).<br />

RECORD TYPE 2.<br />

DATA LIST /READING 8-10.<br />

RECORD TYPE 3.<br />

DATA LIST /MATH 8-10.<br />

END FILE TYPE.<br />

BEGIN DATA<br />

0001 1 B+<br />

0001 2 74<br />

0001 3 83<br />

0002 1 A<br />

0002 2 100<br />

0002 3 71<br />

0003 1 B-<br />

0003 2 88<br />

0003 3 81<br />

0004 1 C<br />

0004 2 94<br />

0004 3 91<br />

END DATA.<br />

• CASE is required for grouped files. CASE specifies variable STUDENT, located in columns<br />

1–4, as the case identification variable.<br />

• The data contain four different values for STUDENT. The working data file therefore has<br />

four cases, one for each value of STUDENT. In a grouped file, each unique value for the<br />

case identification variable defines a case in the working file.<br />

• Each case includes the case identification variable plus the variables defined for each<br />

record type. The values for #TEST are not saved in the working data file. Thus, each case<br />

in the working file has four variables: STUDENT, ENGLISH, READING, and MATH.

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

Saved successfully!

Ooh no, something went wrong!