Can someone help me with the code to convert this numberic date format to ISO8601 fomat (like17OCT2016 2 time 9:10:04 to 2016-10-17T09:10:04), but I want to have a generic code even for missing date or month or both . I am trying to Converting Non-Imputed Partial Dates for a sdtm dataset. how to delete the wrong numbers for time notation (like hours upto 24, minutes upto 60, upto 60 sec etc)
eg:
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T00:10:04
2016-10-17T09:00:04
2016-10-17T09:10:00
please correct me if this notation is wrong in sdtm ISO 8601 fomat?
Hi
check below link if you can locate solution for your problem
http://www.lexjansen.com/nesug/nesug10/ph/ph11.pdf
@buddha_d wrote:Can someone help me with the code to convert this numberic date format to ISO8601 fomat (like17OCT2016 2 time 9:10:04 to 2016-10-17T09:10:04), but I want to have a generic code even for missing date or month or both . I am trying to Converting Non-Imputed Partial Dates for a sdtm dataset. how to delete the wrong numbers for time notation (like hours upto 24, minutes upto 60, upto 60 sec etc)
eg:
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-:10:04
2016-10--T09:10:04
2016----T09:10:042016-10-17T00:10:04
2016-10-17T09:00:04
2016-10-17T09:10:00please correct me if this notation is wrong in sdtm ISO 8601 fomat?
@buddha_d wrote:Can someone help me with the code to convert this numberic date format to ISO8601 fomat (like17OCT2016 2 time 9:10:04 to 2016-10-17T09:10:04), but I want to have a generic code even for missing date or month or both . I am trying to Converting Non-Imputed Partial Dates for a sdtm dataset. how to delete the wrong numbers for time notation (like hours upto 24, minutes upto 60, upto 60 sec etc)
eg:
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-:10:04
2016-10--T09:10:04
2016----T09:10:042016-10-17T00:10:04
2016-10-17T09:00:04
2016-10-17T09:10:00please correct me if this notation is wrong in sdtm ISO 8601 fomat?
Show what you have and what you want.
I want to have a generic code for any missing value in the format
Are you attempting to create SAS datetime values? SAS will not allow creation of a date/datetime with missing components such as month or day the value would always have an assumed month/day. For instance, if you want a SAS datetime value, 2016----T09:10:04 would require something for day and month. Could it be that for your data you want to use the month or day of the month from the previous record (assuming this data is collected in some sort of sequence)?
I don't want to impute anything for the missing date or time values. But this is what i want.
INPUT DATA:
17OCT2016 9:10:04
UNOCT2016 9:10:04
UNOWN2016 9:10:04
17OCT2016 :10:04
UNOCT2016 9::04
UNOWN2016 9:10:
output should look like this
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-00:10:04
2016-10--T09:00:04
2016----T09:10:00
Hi
check below link if you can locate solution for your problem
http://www.lexjansen.com/nesug/nesug10/ph/ph11.pdf
@buddha_d wrote:Can someone help me with the code to convert this numberic date format to ISO8601 fomat (like17OCT2016 2 time 9:10:04 to 2016-10-17T09:10:04), but I want to have a generic code even for missing date or month or both . I am trying to Converting Non-Imputed Partial Dates for a sdtm dataset. how to delete the wrong numbers for time notation (like hours upto 24, minutes upto 60, upto 60 sec etc)
eg:
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-:10:04
2016-10--T09:10:04
2016----T09:10:042016-10-17T00:10:04
2016-10-17T09:00:04
2016-10-17T09:10:00please correct me if this notation is wrong in sdtm ISO 8601 fomat?
@buddha_d wrote:Can someone help me with the code to convert this numberic date format to ISO8601 fomat (like17OCT2016 2 time 9:10:04 to 2016-10-17T09:10:04), but I want to have a generic code even for missing date or month or both . I am trying to Converting Non-Imputed Partial Dates for a sdtm dataset. how to delete the wrong numbers for time notation (like hours upto 24, minutes upto 60, upto 60 sec etc)
eg:
2016-10-17T09:10:04
2016-10--T09:10:04
2016----T09:10:04
2016-10-17T-:10:04
2016-10--T09:10:04
2016----T09:10:042016-10-17T00:10:04
2016-10-17T09:00:04
2016-10-17T09:10:00please correct me if this notation is wrong in sdtm ISO 8601 fomat?
Thanks all for your input.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.