Hi,
Trying to create year, qtr, month from a date in ddmmyy10. format - not working, any ideas?
The date field is a text field with $10 length.
'01/31/2017'
Thank you
@AZIQ1 wrote:
Hi,
Trying to create year, qtr, month from a date in ddmmyy10. format - not working, any ideas?
The date field is a text field with $10 length.
'01/31/2017'
Thank you
This is not a ddmmyy, but a mmddyy format. Use the mmddyy informat in an input function to convert your string to a SAS date variable, and then you can use the year(), month() and qtr() functions to extract the values you want.
If code that you wrote does not work as expected, post the code and the log.
Use the proper posting windows ({i} or "little running man" icon) to preserve formatting.
@AZIQ1 wrote:
Hi,
Trying to create year, qtr, month from a date in ddmmyy10. format - not working, any ideas?
The date field is a text field with $10 length.
'01/31/2017'
Thank you
This is not a ddmmyy, but a mmddyy format. Use the mmddyy informat in an input function to convert your string to a SAS date variable, and then you can use the year(), month() and qtr() functions to extract the values you want.
If code that you wrote does not work as expected, post the code and the log.
Use the proper posting windows ({i} or "little running man" icon) to preserve formatting.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.