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.

END CASE<br />

END CASE<br />

Example<br />

* Restructure a data file to make each data item into a single case.<br />

INPUT PROGRAM.<br />

DATA LIST /#X1 TO #X3 (3(F1,1X)).<br />

VECTOR V=#X1 TO #X3.<br />

LOOP #I=1 TO 3.<br />

- COMPUTE X=V(#I).<br />

- END CASE.<br />

END LOOP.<br />

END INPUT PROGRAM.<br />

Overview<br />

END CASE is used in an INPUT PROGRAM—END INPUT PROGRAM structure to signal that<br />

a case is complete. Control then passes to the commands immediately following the input<br />

program. After these commands are executed for the newly created case, the program<br />

returns to the input program and continues building cases by processing the commands<br />

immediately after the last END CASE command that was executed. For more information<br />

about the flow control in an input program, see INPUT PROGRAM—END INPUT PROGRAM.<br />

END CASE is especially useful for restructuring files, either building a single case from<br />

several cases or building several cases from a single case. It can also be used to generate<br />

data without any data input (see p. 503 for an example).<br />

Basic Specification<br />

The basic specification is simply END CASE. There are no additional specifications.<br />

<strong>Syntax</strong> Rules<br />

• END CASE is available only within an input program and is generally specified within a<br />

loop.<br />

• Multiple END CASE commands can be used within an input program. Each builds a case<br />

from the transformation and data definition commands executed since the last END<br />

CASE command.<br />

• If no END CASE is explicitly specified, an END CASE command is implied immediately<br />

before END INPUT PROGRAM and the input program loops until an end-of-file is encountered<br />

or specified (see END FILE).<br />

508

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

Saved successfully!

Ooh no, something went wrong!