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.

DEFINE—!ENDDEFINE 453<br />

!HEAD (str) Return the first token within a string. The input string is not<br />

changed. !HEAD (‘a b c’) returns a.<br />

!TAIL (str) Return all tokens except the head token. The input string is not<br />

changed. !TAIL(‘a b c’) returns b c.<br />

!QUOTE (str) Put apostrophes around the argument. !QUOTE replicates any<br />

imbedded apostrophe. !QUOTE(abc) returns ‘abc’. If !1 equals<br />

Bill’s, !QUOTE(!1) returns ‘Bill’’s’.<br />

!UNQUOTE (str) Remove quotation marks and apostrophes from the enclosed<br />

string. If !1 equals ‘abc’, !UNQUOTE(!1) is abc. Internal paired<br />

quotation marks are unpaired; if !1 equals ‘Bill”s’, !UNQUOTE(!1)<br />

is Bill’s. The specification !UNQUOTE(!QUOTE(Bill)) returns Bill.<br />

!UPCASE (str) Convert all lowercase characters in the argument to upper<br />

case. !UPCASE(‘abc def’) returns ABC DEF.<br />

!BLANKS (n) Generate a string containing the specified number of blanks.<br />

The n specification must be a positive integer. !BLANKS(5)<br />

returns a string of five blank spaces. Unless the blanks are<br />

quoted, they cannot be processed, since the macro facility<br />

compresses blanks.<br />

!NULL Generate a string of length 0. This can help determine whether<br />

an argument was ever assigned a value, as in !IF (!1 !EQ !NULL)<br />

!THEN. . . .<br />

!EVAL (str) Scan the argument for macro calls. During macro definition, an<br />

argument to a function or an operand in an expression is not<br />

scanned for possible macro calls unless the !EVAL function is<br />

used. It returns a string that is the expansion of its argument. For<br />

example, if mac1 is a macro, then !EVAL(mac1) returns the<br />

expansion of mac1. If mac1 is not a macro, !EVAL(mac1) returns<br />

mac1.<br />

SET Subcommands for Use with Macro<br />

Four subcommands on the SET command were designed for use with the macro facility.<br />

MPRINT Display a list of commands after macro expansion. The specification on<br />

MPRINT is YES or NO (alias ON or OFF). By default, the output does not<br />

include a list of commands after macro expansion (MPRINT NO). The<br />

MPRINT subcommand on SET is independent of the PRINTBACK command.<br />

MEXPAND Macro expansion. The specification on MEXPAND is YES or NO (alias ON or<br />

OFF). By default, MEXPAND is on. SET MEXPAND OFF prevents macro expansion.<br />

Specifying SET MEXPAND ON reestablishes macro expansion.<br />

MNEST Maximum nesting level for macros. The default number of levels that can be<br />

nested is 50. The maximum number of levels depends on storage capacity.

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

Saved successfully!

Ooh no, something went wrong!