I currently have the date/time format in this: "Thurs Dec 19 12:30:31 2019"
I would like to create a new variable so that I am just shown date/time: 19DEC19 12:30:31"
How do I do this?
I am using this as my guide but there is no format that falls in the category above: https://v8doc.sas.com/sashtml/lrcon/zenid-63.htm
Use the scan() function to extract the 3rd, 2nd and 5th "word", concatenate and use the date9. informat to convert to a date. Use the time8. informat on the 4th "word", and then you can build the datetime from the date and time.
@aishajennifer1 wrote:
I currently have the date/time format in this: "Thurs Dec 19 12:30:31 2019"
I would like to create a new variable so that I am just shown date/time: 19DEC19 12:30:31"
How do I do this?
I am using this as my guide but there is no format that falls in the category above: https://v8doc.sas.com/sashtml/lrcon/zenid-63.htm
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.