I am trying to replace a system missing value with the current system date.
I place this row in my command file: If SYSMIS(dateofbirth) dateofbirth = date.dmy(05.07.2013). This will change my missing data on the variable dateofbirth to July 5, 2013 But I would like to have the current system date as the replacing date. I tried several times using $DATE11 in different combination, but it seems I could not find the appropriate syntax. Thanks for help!!! |
If dateofbirth is already a date formatted variable use $TIME. e.g. [If SYSMIS(dateofbirth) dateofbirth = $TIME.]
|
In reply to this post by Gian Luca
At 06:56 AM 7/18/2013, Gian Luca wrote:
>I am trying to replace a system missing value with the current system date. > >If SYSMIS(dateofbirth) dateofbirth = date.dmy(05.07.2013). > >This will change my missing data on the variable dateofbirth to July 5, 2013 >But I would like to have the current system date as the replacing date. At 07:53 AM 7/18/2013, Andy W replied: >If dateofbirth is already a date formatted variable use $TIME. e.g. > >If SYSMIS(dateofbirth) dateofbirth = $TIME. Right; but $TIME is a date-time value. To have the date part only, i.e. omitting the time since midnight, use If SYSMIS(dateofbirth) dateofbirth = XDATE.DATE($TIME). ===================== 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 |
Administrator
|
Don't forget about $DATE.
$DATE Current date in international date format with two-digit year. The format is A9 in the form dd-mmm-yy. $DATE11 Current date in international date format with four-digit year. The format is A11 in the form dd-mmm-yyyy.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |