SPSS: Replace missing values with date

3.7k views Asked by At

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!

2

There are 2 answers

0
lotus On

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

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

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.