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.

434 DATE<br />

• The DATE command invalidates any previous USE and PREDICT commands specified.<br />

The USE and PREDICT periods must be respecified after DATE.<br />

Limitations<br />

• There is no limit on the number of keywords on the DATE command. However, keywords<br />

that describe long time periods (YEAR, QUARTER, MONTH) cannot be used on the same<br />

command with keywords that describe short time periods (WEEK, DAY, HOUR, MINUTE,<br />

SECOND).<br />

• User-defined variable names must not conflict with DATE variable names.<br />

Example 1<br />

DATE Y 1960 M.<br />

• This command generates variables DATE_, YEAR_, and MONTH_.<br />

• YEAR_ has a starting value of 1960. MONTH_ starts at the default value of 1.<br />

• By default, YEAR_ has no periodicity, and MONTH_ has a periodicity of 12.<br />

Example 2<br />

DATE reports the following:<br />

Name Label<br />

YEAR_ YEAR, not periodic<br />

MONTH_ MONTH, period 12<br />

DATE_ DATE. FORMAT: "MMM YYYY"<br />

The following is a partial listing of the new variables:<br />

YEAR_ MONTH_ DATE_<br />

1960 1 JAN 1960<br />

1960 2 FEB 1960<br />

1960 3 MAR 1960<br />

1960 4 APR 1960<br />

...<br />

1960 10 OCT 1960<br />

1960 11 NOV 1960<br />

1960 12 DEC 1960<br />

1961 1 JAN 1961<br />

1961 2 FEB 1961<br />

...<br />

1999 4 APR 1999<br />

1999 5 MAY 1999<br />

1999 6 JUN 1999<br />

DATE WEEK DAY 1 5 HOUR 1 8.<br />

• This command creates four variables (DATE_, WEEK_, DAY_, and HOUR_) in a file where<br />

observations occur hourly in a 5-day, 40-hour week.<br />

• For WEEK_, the default starting value is 1 and the default periodicity is none.

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

Saved successfully!

Ooh no, something went wrong!