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.

REPORT 1417<br />

• More than one string variable can be defined on STRING.<br />

• If a case has a missing value for a variable within the parentheses, the variable passes the<br />

missing value to the temporary variable without affecting other elements specified.<br />

• A string variable defined in REPORT cannot exceed the system page width.<br />

• String variables defined on STRING can be used on VARIABLES or BREAK.<br />

The following options can be used to specify how components are to be concatenated:<br />

(width) Width of the preceding variable within the string. The default is the dictionary<br />

width of the variable. The maximum width for numeric variables within<br />

the string definition is 16. The maximum width for a string variable is the<br />

system page width. If the width specified is less than that required by the<br />

value, numeric values are displayed as asterisks and string values are truncated.<br />

If the width exceeds the width of a value, numeric values are padded<br />

with zeros on the left and string values are padded with blanks on the right.<br />

(BLANK) Left-pad values of the preceding numeric variable with blanks. The default<br />

is to left-pad values of numeric variables with zeros. If a numeric variable<br />

has a dollar or comma format, it is automatically left-padded with blanks.<br />

‘literal’ User-specified string. Any combination of characters can be specified within<br />

apostrophes or quotation marks.<br />

Example<br />

/STRING=JOB1(AVAR NVAR)<br />

JOB2(AVAR(2) NVAR(3))<br />

JOB3(AVAR(2) NVAR(BLANK) (4))<br />

• STRING defines three string variables to be used within the report.<br />

• Assume that AVAR is a string variable read from a four-column field using keyword FIXED<br />

on DATA LIST and that NVAR is a computed numeric variable with the default format of<br />

eight columns with two implied decimal places.<br />

• If a case has value KJ for AVAR and value 241 for NVAR, JOB1 displays the value<br />

‘KJ 00241.00’, JOB2 the value ‘KJ241’, and JOB3 the value ‘KJ 241’. If NVAR has the<br />

system-missing value for a case, JOB1 displays the value ‘KJ.’<br />

Example<br />

/STRING=SOCSEC(S1 ’-’ S2 ’-’ S3)<br />

• STRING concatenates the three variables S1, S2, and S3, each of which contains a segment<br />

of the social security number.<br />

• Hyphens are inserted between the segments when the values of SOCSEC are displayed.<br />

• This example assumes that the variables S1, S2, and S3 were read from three-column,<br />

two-column, and four-column fields respectively, using the keyword FIXED on DATA LIST.<br />

These variables would then have default format widths of 3, 2, and 4 columns and would<br />

not be left-padded with zeros.

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

Saved successfully!

Ooh no, something went wrong!