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.

Table 1 Output data formats (Continued)<br />

FORMATS 595<br />

Type PRINT Min w Max w Max d<br />

8 q Q yyyy<br />

MOYRw yes 6 40 mmm yy<br />

8 mmm yyyy<br />

WKYRw yes 8 40 ww WK yy<br />

10 ww WK yyyy<br />

WKDAYw yes 2** 40<br />

MONTHw yes 3** 40<br />

TIMEw yes 5†† 40 hh:mm<br />

TIMEw.d yes 10 40 16 hh:mm:ss.s<br />

DTIMEw yes 8†† 40 dd hh:mm<br />

DTIMEw.d yes 13 40 16 dd hh:mm:ss.s<br />

DATETIMEw yes 17†† 40 dd-mmm-yyyy hh:mm<br />

DATETIMEw.d yes 22 40 16 dd-mmm-yyyy hh:mm:ss.s<br />

*Add number of decimals plus 1 if number of decimals is more than 0. Total width cannot exceed 40<br />

characters.<br />

†Must be a multiple of 2.<br />

**As the field width is expanded, the output string is expanded until the entire name of the day or month<br />

is produced.<br />

††Add 3 to display seconds.<br />

Operations<br />

• Unlike most transformations, FORMATS takes effect as soon as it is encountered in the<br />

command sequence. Special attention should be paid to its position among commands. For<br />

more information, see “<strong>Command</strong> Order” on p. 8.<br />

• Variables not specified on FORMATS retain their current print and write formats in the<br />

working file. To see the current formats, use the DISPLAY command.<br />

• The new formats are changed only in the working file and are in effect for the duration of<br />

the current session or until changed again with a FORMATS, PRINT FORMATS, or WRITE<br />

FORMATS command. Formats in the original data file (if one exists) are not changed unless<br />

the file is resaved with the SAVE or XSAVE command.<br />

• New numeric variables created with transformation commands are assigned default print<br />

and write formats of F8.2 (or the format specified on the FORMAT subcommand of SET).<br />

The FORMATS command can be used to change the new variable’s print and write formats.<br />

• New string variables created with transformation commands are assigned the format specified<br />

on the STRING command that declares the variable. FORMATS cannot be used to<br />

change the format of a new string variable.<br />

• If a numeric data value exceeds its width specification, the program attempts to display<br />

some value nevertheless. The program first rounds decimal values, then removes punctuation<br />

characters, then tries scientific notation, and finally, if there is still not enough space,<br />

produces asterisks indicating that a value is present but cannot be displayed in the assigned<br />

width.

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

Saved successfully!

Ooh no, something went wrong!