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.

The LIST output from these commands is shown in Figure 16.<br />

Figure 16 Output illustrating QYR, MOYR, and WKYR formats<br />

VAR1 VAR2 VAR3<br />

4 Q 1990 OCT 1990 43 WK 1990<br />

4 Q 1990 OCT 1990 43 WK 1990<br />

4 Q 2001 OCT 2001 43 WK 2001<br />

Example<br />

Date and Time 59<br />

DATA LIST FIXED<br />

/VAR1 1-11 (TIME,2) VAR2 13-21 (TIME) VAR3 23-28 (TIME).<br />

BEGIN DATA<br />

1:2:34.75 1:2:34.75 1:2:34<br />

END DATA.<br />

LIST.<br />

• TIME reads and writes time of the day or a time interval.<br />

• Internally, the TIME values are stored as the number of seconds from midnight of the day<br />

or of the time interval.<br />

The LIST output from these commands is shown in Figure 17.<br />

Figure 17 Output illustrating TIME format<br />

VAR1 VAR2 VAR3<br />

1:02:34.75 1:02:34 1:02<br />

Example<br />

DATA LIST FIXED<br />

/VAR1 1-9 (WKDAY) VAR2 10-18 (WKDAY)<br />

VAR3 20-29 (MONTH) VAR4 30-32 (MONTH) VAR5 35-37 (MONTH).<br />

BEGIN DATA<br />

Sunday Sunday January 1 Jan<br />

Monday Monday February 2 Feb<br />

Tues Tues March 3 Mar<br />

Wed Wed April 4 Apr<br />

Th Th Oct 10 Oct<br />

Fr Fr Nov 11 Nov<br />

Sa Sa Dec 12 Dec<br />

END DATA.<br />

FORMATS VAR2 VAR5 (F2).<br />

LIST.<br />

• WKDAY reads and writes the day of the week; MONTH reads and writes the month of the<br />

year.<br />

• Values for WKDAY are entered as strings but stored as numbers. They can be used in<br />

arithmetic operations but not in string functions.<br />

• Values for MONTH can be entered either as strings or as numbers, but are stored as<br />

numbers. They can be used in arithmetic operations but not in string functions.<br />

• To display the values as numbers, assign an F format to the variable, as was done for VAR2<br />

and VAR5 in the above example.

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

Saved successfully!

Ooh no, something went wrong!