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.

DATA LIST 429<br />

• The width (w) portion of each format must specify the total number of characters in the<br />

widest value. DOLLAR5 format for COST accepts the five-digit value 78788, which<br />

displays as $78,788. Thus, the specified input format DOLLAR5 generates an output<br />

format DOLLAR7. The program automatically expands the width of the output format to<br />

accommodate the dollar sign and comma in displayed output.<br />

String Formats<br />

String (alphanumeric) variables can contain any numbers, letters, or characters, including<br />

special characters and imbedded blanks. Numbers entered as values for string variables<br />

cannot be used in calculations unless you convert them to numeric format (see RECODE). On<br />

DATA LIST, a string variable is defined with an A format if data are in standard character form<br />

or an AHEX format if data are in hexadecimal form. For further discussion of string formats,<br />

see “String Variable Formats” on p. 33.<br />

• For fixed-format data, the width of a string variable is either implied by the column location<br />

specification or specified by the w on the FORTRAN-like format. For freefield data,<br />

the width must be specified on the FORTRAN-like format.<br />

• The string formats defined on DATA LIST are both input and output formats. You cannot<br />

change the format of a defined string variable in this program. However, you can use the<br />

STRING command to define a new string variable and COMPUTE to copy the values from<br />

the old variable (see COMPUTE).<br />

• AHEX format is available only for fixed-format data. Since each set of two hexadecimal<br />

characters represents one standard character, the width specification must be an even<br />

number. The output format for a variable in AHEX format is A format with half the specified<br />

width.<br />

• If a string in the data is longer than its specified width, the string is truncated and a<br />

warning message is displayed. If the string in the data is shorter, it is right-padded with<br />

blanks and no warning message is displayed.<br />

• For fixed-format data, all characters within the specified or implied columns, including<br />

leading, trailing, and imbedded blanks and punctuation marks, are read as the value of the<br />

string.<br />

• For freefield data without a specified delimiter, string values in the data must be enclosed<br />

in apostrophes or quotation marks if the string contains a blank or a comma. Otherwise,<br />

the blank or comma is treated as a delimiter between values. Apostrophes can be included<br />

in a string by enclosing the string in quotation marks. Quotation marks can be included in<br />

a string by enclosing the string in apostrophes.<br />

Example<br />

DATA LIST FILE=WINS FREE /POSTPOS NWINS * POSNAME (A24).<br />

• POSNAME is specified as a 24-character string. The asterisk preceding POSNAME indicates<br />

that POSTPOS and NWINS are read with the default format. If the asterisk was not<br />

specified, the program would apply the A24 format to POSNAME and then issue an error<br />

message indicating that there are more variables than specified formats.

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

Saved successfully!

Ooh no, something went wrong!