Dear users, I have a variable which contains
the year in first four places and the next two places represents month
and the next two are represents days(Ex : 20160126 represents 26th Jan
2016).My objective is to validate the days according to months and
years.can i create 3 variables from the given variable which are
represents year,month,date.suggestions please. |
I suggest you put a little more information in your subject ********************************* Notice: This e-mail and any attachments may contain confidential and privileged information. If you are not the intended recipient, please notify the sender immediately by return e-mail, do not use the information, delete this e-mail and destroy any copies. Any dissemination or use of this information by a person other than the intended recipient is unauthorized and may be illegal. Email transmissions cannot be guaranteed to be secure or error free. The sender therefore does not accept any liability for errors or omissions in the contents of this message that arise as a result of email transmissions. From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of venkatesh gandi Dear users, I have a variable which contains the year in first four places and the next two places represents month and the next two are represents days(Ex : 20160126 represents 26th Jan 2016).My objective is to validate the days according to months and years.can i create 3 variables from the given variable which are represents year,month,date.suggestions please. Thank you, Gandi ===================== 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 |
In reply to this post by venkatesh gandi
SPSS has a Date and Time wizard (transform -> date and time wizard -> option 2). Follow its instructions and it should do the trick. I assume that invalid dates will be returned as system missings.On Mon, Nov 9, 2015 at 9:50 PM, venkatesh gandi <[hidden email]> wrote:
-- ________________________________________________ Maurice Vergeer To contact me, see http://mauricevergeer.nl/node/5 To see my publications, see http://mauricevergeer.nl/node/1 ________________________________________________ |
In reply to this post by venkatesh gandi
Check out COMPUTE with trunc and mod. From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of venkatesh gandi Dear users, I have a variable which contains the year in first four places and the next two places represents month and the next two are represents days(Ex : 20160126 represents 26th Jan 2016).My objective is to validate the days according to months and years.can i create 3 variables from the given variable which are represents year,month,date.suggestions please. Thank you, Gandi ===================== 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
|
In reply to this post by venkatesh gandi
See STRING, CHAR.SUBSTR, NUMBER and DATE.MDY functions, or TRUNC and MOD depending upon whether the source is a string or numeric.
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 |