jam320
jam320

Reputation: 1

SPSS: Replace missing values with date

I have a date field with missing values. I want to replace the missing values with a specified date. I attempted to recode the variable by assigning a value to the missing but it didn't seem to allow xx/xx/xxxx formatted inputs. I attempted to determine the numeric value of my date thinking this was what the recode field wanted but wasn't successful with that either. I'm thinking a compute if statement may be possible i.e. if system-missing input date, but again I'm at a loss on the right commands. Any help would be greatly appreciated!

Upvotes: 0

Views: 4011

Answers (2)

jam320
jam320

Reputation: 1

Thanks for all the suggestions - I checked the formats . I'm guessing that SPSS had a problem with the column because it had a date subtraction formula in it. So I removed the formula (pasted values only), reopened it in SPSS and it worked.

Upvotes: 0

lroha
lroha

Reputation: 34406

You can replace missing values with a specified date like so:

if missing(datevar) datevar = date.mdy(12,20,1999).
exe.

Upvotes: 1

Related Questions