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.

Example<br />

WRITE 1673<br />

WRITE OUTFILE=PRSNNL / MOHIRED YRHIRED DEPT SALARY NAME.<br />

FREQUENCIES VARIABLES=DEPT.<br />

• WRITE writes values for each variable on the variable list to file PRSNNL. The FREQUENCIES<br />

procedure reads the data and causes WRITE to be executed.<br />

• All variables are written with their dictionary formats.<br />

Example<br />

Formats<br />

WRITE OUTFILE=PRSNNL /ALL.<br />

EXECUTE.<br />

• WRITE writes values for all user-defined variables in the working data file to file PRSNNL.<br />

The EXECUTE command executes WRITE.<br />

By default, WRITE uses the dictionary write formats. You can specify formats for some or all<br />

variables specified on WRITE. For a string variable, the specified format must have the same<br />

width as that of the dictionary format.<br />

• Format specifications can be either column-style or FORTRAN-like (see DATA LIST). The<br />

column location specified with column-style formats or implied with FORTRAN-like<br />

formats refers to the column in which the variable will be written.<br />

• A format specification following a list of variables applies to all the variables in the list.<br />

Use an asterisk to prevent the specified format from applying to variables preceding the<br />

asterisk. The specification of column locations implies a default print format, and that format<br />

will apply to all previous variables if no asterisk is used.<br />

• All available formats can be specified on WRITE. Note that hex and binary formats use<br />

different widths. For example, the AHEX format must have a width twice that of the corresponding<br />

A format. For more information on specifying formats and on the formats<br />

available, see DATA LIST and “Variable Formats” on p. 25 in Volume I.<br />

• Format specifications are in effect only for the WRITE command. They do not change the<br />

dictionary write formats.<br />

• To specify a blank between variables in the output, use a string (see “Strings” on p. 1674),<br />

specify blank columns in the format, or use an X or T format element in the WRITE specifications<br />

(see DATA LIST for information on X and T).<br />

Example<br />

WRITE OUTFILE=PRSNNL / TENURE (F2.0) ’ ’ MOHIRED YRHIRED DEPT *<br />

SALARY85 TO SALARY88 (4(DOLLAR8,1X)) NAME.<br />

EXECUTE.<br />

• Format F2.0 is specified for TENURE. A blank between apostrophes is specified as a string<br />

after TENURE to separate values of TENURE from those of MOHIRED.

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

Saved successfully!

Ooh no, something went wrong!