Date variable problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Date variable problem

Maguin, Eugene
Here's a curious problem. Anybody seen this before? And, more importantly,
how to fix it?

A person here has been entering data directly into the spss data window.
Several of the variables are date of births (DOBs). In some cases there was
not a DOB value for the case. So they tried to put a value in as a missing
value designator, like 0 or -1. So, when you do the frequencies on those
variables, and this is the interesting part, those values print as '.
'. Not sysmis, those are at the bottom of the frequency table. We can find
the cases using a list command because it gives a warning. But, and another
interesting part, I can not edit the value out in the data view, i.e.,
change it to sysmis.

If I do

Do if (not(sysmis(dob1))).
+  compute dob1=$sysmis.
End if.

It gets rid of the funny values along with all valid values.

I tried this also because I got this message when tried to extract the year
value.

Warnings
For a subfunction other than TDAY, HOUR, MINUTE, or SECOND, the argument to
the XDATE function is negative.  The result has been set to the
system-missing value. >Command line: 10  Current case: 2  Current splitfile
group: 1
For a subfunction other than TDAY, HOUR, MINUTE, or SECOND, the argument to
the XDATE function contains no date - just a time of day.  The result has
been set to the system-missing value. >Command line: 10  Current case: 83
Current splitfile group: 1

Which suggested

compute #year=xdate.year(dob1).
if (sysmis(#year)) dob1=$sysmis.

However, this did not work either.

Suggestions, anyone??

Thanks, Gene Maguin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Date variable problem

Oliver, Richard
Values less that 86400 for dates are not system-missing. They just can't be displayed as dates; so the system-missing symbol is displayed, which is probably a little confusing. If you change the display format to F (numeric), you'll see the underlying value, not the system-missing symbol.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gene Maguin
Sent: Monday, May 19, 2008 11:31 AM
To: [hidden email]
Subject: Date variable problem

Here's a curious problem. Anybody seen this before? And, more importantly,
how to fix it?

A person here has been entering data directly into the spss data window.
Several of the variables are date of births (DOBs). In some cases there was
not a DOB value for the case. So they tried to put a value in as a missing
value designator, like 0 or -1. So, when you do the frequencies on those
variables, and this is the interesting part, those values print as '.
'. Not sysmis, those are at the bottom of the frequency table. We can find
the cases using a list command because it gives a warning. But, and another
interesting part, I can not edit the value out in the data view, i.e.,
change it to sysmis.

If I do

Do if (not(sysmis(dob1))).
+  compute dob1=$sysmis.
End if.

It gets rid of the funny values along with all valid values.

I tried this also because I got this message when tried to extract the year
value.

Warnings
For a subfunction other than TDAY, HOUR, MINUTE, or SECOND, the argument to
the XDATE function is negative.  The result has been set to the
system-missing value. >Command line: 10  Current case: 2  Current splitfile
group: 1
For a subfunction other than TDAY, HOUR, MINUTE, or SECOND, the argument to
the XDATE function contains no date - just a time of day.  The result has
been set to the system-missing value. >Command line: 10  Current case: 83
Current splitfile group: 1

Which suggested

compute #year=xdate.year(dob1).
if (sysmis(#year)) dob1=$sysmis.

However, this did not work either.

Suggestions, anyone??

Thanks, Gene Maguin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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