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.

1674 WRITE<br />

Strings<br />

• MOHIRED, YRHIRED, and DEPT are written with default formats because the asterisk prevents<br />

them from receiving the DOLLAR8 format specified for SALARY85 to SALARY88.<br />

The 1X format element is specified with DOLLAR8 to add one blank after each value of<br />

SALARY85 to SALARY88.<br />

• NAME uses the default dictionary format.<br />

You can specify strings within the variable list. Strings must be enclosed in apostrophes or<br />

quotation marks.<br />

• If a format is specified for a variable list, the application of the format is interrupted by a<br />

specified string. Thus, the string has the same effect within a variable list as an asterisk.<br />

Example<br />

WRITE OUTFILE=PRSNNL<br />

/EMPLOYID ’1’ MOHIRED YRHIRED SEX AGE JOBCAT NAME<br />

/EMPLOYID ’2’ DEPT86 TO DEPT88 SALARY86 TO SALARY88.<br />

EXECUTE.<br />

• Strings are used to assign the constant 1 to record 1 of each case, and 2 to record 2 to provide<br />

record identifiers in addition to the case identifier EMPLOYID.<br />

RECORDS Subcommand<br />

RECORDS indicates the total number of lines written per case. The number specified on<br />

RECORDS is informational only. The actual specification that causes variables to be written<br />

on a new line is a slash within the variable specifications. Each new line is requested by<br />

another slash.<br />

• RECORDS must be specified before the slash that precedes the start of the variable<br />

specifications.<br />

• The only specification on RECORDS is an integer to indicate the number of records for<br />

the output. If the number does not agree with the actual number of records indicated by<br />

slashes, the program issues a warning and ignores the specification on RECORDS.<br />

• Specifications for each line of output must begin with a slash. An integer can follow the<br />

slash, indicating the line on which values are to be written. The integer is informational<br />

only. It cannot be used to rearrange the order of records in the output. If the integer does<br />

not agree with the actual record number indicated by the number of slashes in the variable<br />

specifications, the integer is ignored.<br />

• A slash that is not followed by a variable list generates a blank line in the output.<br />

Examples<br />

WRITE OUTFILE=PRSNNL RECORDS=2<br />

/EMPLOYID NAME DEPT<br />

/EMPLOYID TENURE SALARY.<br />

EXECUTE.

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

Saved successfully!

Ooh no, something went wrong!