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.

64 Universals<br />

on the first day of the first month of the quarter, a DATE9 print format<br />

for the same value is displayed as 01-OCT-57.<br />

DATE.MOYR(m,y) Combine month and year. The value of the month must be expressed<br />

as an integer between and including 1 and 12. The year can be<br />

expressed as two or four digits. For example, the command<br />

COMPUTE START=DATE.MOYR(MONTH,YEAR).<br />

displays NOV 57 for START when MONTH is 11 and YEAR is 57 and<br />

the print format is MOYR.<br />

DATE.WKYR(w,y) Combine week and year. The week must be an integer between and<br />

including 1 and 53. The year can be represented by two or four digits.<br />

For example, the command<br />

COMPUTE WEEK=DATE.WKYR(WK,YEAR).<br />

displays 26-NOV-57 for WEEK when WK is 48 and YEAR is 57 and the<br />

print format is DATE9. The number of the week in the WKYR format is<br />

calculated beginning with the first day of the year. It may be different<br />

from the number of the calendar week.<br />

TIME.HMS(h,m,s) Combine hour, minute, and second into a time interval. For example,<br />

the command<br />

COMPUTE PERIOD1= TIME.HMS (HR,MIN,SEC).<br />

produces an interval of 45,030 seconds for PERIOD1 when HR equals<br />

12, MIN equals 30, and SEC equals 30. The value can be displayed as<br />

12:30:30 with a TIME8 print format.<br />

You can supply one, two, or three arguments. Trailing arguments can be<br />

omitted and default to 0. The value of the first nonzero argument can<br />

spill over into the next higher argument. For example, the command<br />

COMPUTE PERIOD2=TIME.HMS(HR,MIN).<br />

produces an interval of 5400 seconds for PERIOD2 when HR is 0 and MIN<br />

is 90. The value can be displayed as 01:30 with a TIME5 print format.<br />

You can have a non-integer value for the last argument. For example,<br />

the command<br />

COMPUTE PERIOD3=TIME.HMS(HR).<br />

produces an interval of 5400 seconds for PERIOD3 when HR equals 1.5<br />

and is displayed as 01:30 with a TIME5 format. When you supply a<br />

nonzero argument to a function, each of the lower-level units must be<br />

within the range of −60 to +60.<br />

TIME.DAYS(d) Aggregate days into a time interval. The argument can be expressed<br />

as any numeric value. For example, the command<br />

COMPUTE NDAYS=TIME.DAYS(SPELL).<br />

with a value of 2.5 for SPELL generates a value for NDAYS that is displayed<br />

as 2 12:00 with a DTIME7 format.

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

Saved successfully!

Ooh no, something went wrong!