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.

WRITE FORMATS<br />

WRITE FORMATS varlist (format) [varlist...]<br />

Example<br />

Overview<br />

WRITE FORMATS SALARY (DOLLAR8)<br />

/ HOURLY (DOLLAR7.2)<br />

/ RAISE BONUS (PCT2).<br />

WRITE FORMATS changes variable write formats. Write formats are output formats and<br />

control the form in which values are written by the WRITE command.<br />

WRITE FORMATS changes only write formats. To change print formats, use the PRINT<br />

FORMATS command. To change both the print and write formats with a single specification,<br />

use the FORMATS command. For information on assigning input formats during data definition,<br />

see DATA LIST. For a more detailed discussion of input and output formats, see “Variable<br />

Formats” on p. 25 in Volume I.<br />

Basic Specification<br />

The basic specification is a variable list followed by the new format specification in parentheses.<br />

All specified variables receive the new format.<br />

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

• You can specify more than one variable or variable list, followed by a format in parentheses.<br />

Only one format can be specified after each variable list. For clarity, each set of<br />

specifications can be separated by a slash.<br />

• You can use keyword TO to refer to consecutive variables in the working data file.<br />

• The specified width of a format must include enough positions to accommodate any<br />

punctuation characters such as decimal points, commas, dollar signs, or date and time<br />

delimiters. (This differs from assigning an input format on DATA LIST, where the<br />

program automatically expands the input format to accommodate punctuation characters<br />

in output.)<br />

• Custom currency formats (CCw, CCw.d) must first be defined on the SET command<br />

before they can be used on WRITE FORMATS.<br />

• WRITE FORMATS cannot be used with string variables. To change the length of a string<br />

variable, declare a new variable of the desired length with the STRING command and<br />

then use COMPUTE to copy values from the existing string into the new string.<br />

1676

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

Saved successfully!

Ooh no, something went wrong!