Thanks for the hints. I used both ways and it is still not working. monyy=put(report_date,datetime16.); returns some wired dates that do not match with I have and monyy=put(datepart(report_date),monyy7.); returns AUG1960 for every observation in my report_date. report_date belongs to 201706. It seems datepart(report_date) picks the wrong order for example 20170601 is reported AUG60. Very good question about why I need this, I have daily transaction data for different companies. I need to aggregate the data by company per month. Since I use PROC MEANS, for the CLASS part of the code if I provide report_date (daily) the code does not spit out what I need, Now, if there is a better way to do this aggravation I'll forget about the date conversion 🙂 and here is what my data looks like after using monyy=put(report_date,datetime16.);
... View more