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 />

* Keyword !CHAREND.<br />

DEFINE macname (!POSITIONAL !CHAREND (’/’))<br />

frequencies variables = !1.<br />

!ENDDEFINE.<br />

DEFINE—!ENDDEFINE 449<br />

macname A B C D / E F.<br />

• Although E and F are not part of the positional argument and are not used in the macro<br />

expansion, the program still reads them as text and interprets them in relation to where the<br />

macro definition ends. In this example, macro definition ends after the expanded variable<br />

list (D). E and F are names of variables. Thus, E and F are added to the variable list and<br />

FREQUENCIES is executed with six variables: A, B, C, D, E, and F.<br />

Example<br />

* Keyword !ENCLOSE.<br />

DEFINE macname (!POSITIONAL !ENCLOSE(’(’,’)’))<br />

frequencies variables = !1<br />

/statistics = default skewness.<br />

!ENDDEFINE.<br />

macname (A B C) D E.<br />

• When the macro is called, the three tokens enclosed in parentheses, A, B, and C, are<br />

assigned to the positional argument !1 in the macro body.<br />

• After macro expansion is complete, the program reads the remaining characters on the<br />

macro call as text. In this instance, the macro definition ends with keyword SKEWNESS<br />

on the STATISTICS subcommand. Adding variable names to the STATISTICS subcommand<br />

is not valid syntax. The program generates a warning message but is still able to execute<br />

the frequencies command. Frequency tables and the specified statistics are generated for<br />

the variables A, B, and C.<br />

Example<br />

* Keyword !CMDEND’.<br />

DEFINE macname (!POSITIONAL !TOKENS(2)<br />

/!POSITIONAL !CMDEND)<br />

frequencies variables = !1.<br />

correlations variables= !2.<br />

!ENDDEFINE.<br />

macname A B C D E.<br />

• When the macro is called, the first two tokens following macname (A and B) are assigned to<br />

the positional argument !1. C, D, and E are assigned to the positional argument !2. Thus, the<br />

variables used for FREQUENCIES are A and B, and the variables used for CORRELATION are<br />

C, D, and E.

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

Saved successfully!

Ooh no, something went wrong!