recoding a missing date field

View: New views
3 Messages — Rating Filter:   Alert me  

recoding a missing date field

by Albert-jan Roskam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If I want to recode the system missing value of a date variable (blank field in data editor) to 999, why doesn't appear October 14,
1582 as the date? After all, 999 would mean  999 seconds after the beginning of the Gregorian calendar. Oct 14 1582 is at least a clearly recognizable odd date.

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Before you criticize someone, walk a mile in their shoes, that way
when you do criticize them, you're a mile away and you have their shoes!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

Re: recoding a missing date field

by Jon K Peck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The first of the SPSS date era is special.  Small integers are used for year and month numbers.

But the system missing value would be the same for dates as for other numeric variables.

HTH,
Jon Peck
SPSS, an IBM Company
peck@...
312-651-3435



From: Albert-Jan Roskam <fomcl@...>
To: SPSSX-L@...
Date: 10/28/2009 03:56 AM
Subject: [SPSSX-L] recoding a missing date field
Sent by: "SPSSX(r) Discussion" <SPSSX-L@...>





If I want to recode the system missing value of a date variable (blank field in data editor) to 999, why doesn't appear October 14,
1582 as the date? After all, 999 would mean  999 seconds after the beginning of the Gregorian calendar. Oct 14 1582 is at least a clearly recognizable odd date.

Cheers!!
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Before you criticize someone, walk a mile in their shoes, that way
when you do criticize them, you're a mile away and you have their shoes!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@... (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



Re: recoding a missing date field

by Richard Ristow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 05:51 AM 10/28/2009, Albert-Jan Roskam wrote:

If I want to recode the system missing value of a date variable (blank field in data editor) to 999, why doesn't appear October 14, 1582 as the date?

At 08:53 AM 10/28/2009, Jon K Peck wrote:

The first of the SPSS date era is special.  Small integers are used for year and month numbers.

I'm not sure what that second sentence means - Jon, is that something about SPSS date representation that I don't know. But to clarify the first sentence: SPSS does not regard October 14, 1582 as a representable date. I think Richard Oliver may have told me why, once, but if so, I don't remember it.

NUMERIC DateTime (DATETIME17).
COMPUTE DateTime = Number.
LIST.

List
|-----------------------------|---------------------------|
|Output Created               |29-OCT-2009 15:57:35       |
|-----------------------------|---------------------------|
 Number          DateTime

>Warning # 1140
>The value to be output under one of the date formats is negative or has a
>date part of zero.  The result has been set to the system-missing value.

    999                 .
 87,399 15-OCT-1582 00:16

Number of cases read:  2    Number of cases listed:  2
=============================
APPENDIX: Test data, and code
=============================
NEW FILE.
INPUT PROGRAM.
.  NUMERIC Number(COMMA7).
.  COMPUTE Number = 999.
.  END CASE.
.  COMPUTE Number = 999 + TIME.DAYS(1).
.  END CASE.
END FILE.
END INPUT PROGRAM.

NUMERIC DateTime (DATETIME17).
COMPUTE DateTime = Number.
LIST.

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD