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.

COMMENT<br />

{COMMENT} text<br />

{ * }<br />

Overview<br />

COMMENT inserts explanatory text within the command sequence. Comments are included<br />

among the commands printed back in the output; they do not become part of the information<br />

saved in an SPSS-format data file. To include commentary in the dictionary of a data file,<br />

use the DOCUMENT command.<br />

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

Example<br />

• The first line of a comment can begin with the keyword COMMENT or with an asterisk (*).<br />

Comment text can extend for multiple lines and can contain any characters. A period is<br />

required at the end of the last line to terminate the comment.<br />

• Use /* and */ to set off a comment within a command. The comment can be placed<br />

wherever a blank is valid (except within strings) and should be preceded by a blank.<br />

Comments within a command cannot be continued onto the next line.<br />

• The closing */ is optional when the comment is at the end of the line. The command can<br />

continue onto the next line just as if the inserted comment was a blank.<br />

• Comments cannot be inserted within data lines.<br />

* Create a new variable as a combination of two old variables;<br />

the new variable is a scratch variable used later in the<br />

session; it will not be saved with the data file.<br />

COMPUTE #XYVAR=0.<br />

IF (XVAR EQ 1 AND YVAR EQ 1) #XYVAR=1.<br />

• The three-line comment will be included in the display file but will not be part of the data<br />

file if the working data file is saved.<br />

Example<br />

IF (RACE EQ 1 AND SEX EQ 1) SEXRACE = 1. /*White males.<br />

• The comment is entered on a command line. The closing */ is not needed because the<br />

comment is at the end of the line.<br />

245

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

Saved successfully!

Ooh no, something went wrong!