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.

Example<br />

PRINT EJECT 1257<br />

DO IF MOD($CASENUM,50) = 1.<br />

PRINT EJECT<br />

FILE=OUT /’ NAME ’ 1 ’DEPT’ 25 ’HIRED’ 30 ’ SALARY’ 35.<br />

END IF.<br />

PRINT FILE=OUT / NAME DEPT *<br />

MOHIRED 30-31 ’/’ YRHIRED *<br />

SALARY 35-42(DOLLAR).<br />

EXECUTE.<br />

• In this example, DO IF specifies that PRINT EJECT is executed if MOD (the remainder) of<br />

$CASENUM divided by 50 equals 1 (see p. 38 for a description of MOD). Thus, column<br />

headings are displayed on a new page after every 50th case.<br />

• If PRINT were used instead of PRINT EJECT, column headings would display after every<br />

50th case but would not appear at the top of a new page.<br />

• Both PRINT EJECT and PRINT specify the same file for the output. If the FILE subcommands<br />

on PRINT EJECT and PRINT do not specify the same file, the column headings and<br />

the displayed values end up in different files.

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

Saved successfully!

Ooh no, something went wrong!