I have a SAS Date variable (Date) in the format YYYYMMDD : 2017-10-15. When I convert it to MONYY7. (Date1) it displays OCT2017, which is great, but it remembers the day ? So when I Group on Date1, I get Two groups, because Date has Values of 14th October 2017 and 15th of October 2017. How do I stop this ?
@alan01011 wrote:
I have a SAS Date variable (Date) in the format YYYYMMDD : 2017-10-15. When I convert it to MONYY7. (Date1) it displays OCT2017, which is great, but it remembers the day ? So when I Group on Date1, I get Two groups, because Date has Values of 14th October 2017 and 15th of October 2017. How do I stop this ?
What do you mean by "when I group on Date1..."??? How do you do the grouping? Show us the code.
Generally, most SAS procedures (but not all) that do grouping will recognize the format and all records in OCT 2017 will be grouped together. One particular exception is PROC SQL, which does not group by formatted values.
@alan01011 wrote:
I have a SAS Date variable (Date) in the format YYYYMMDD : 2017-10-15. When I convert it to MONYY7. (Date1) it displays OCT2017, which is great, but it remembers the day ? So when I Group on Date1, I get Two groups, because Date has Values of 14th October 2017 and 15th of October 2017. How do I stop this ?
What do you mean by "when I group on Date1..."??? How do you do the grouping? Show us the code.
Generally, most SAS procedures (but not all) that do grouping will recognize the format and all records in OCT 2017 will be grouped together. One particular exception is PROC SQL, which does not group by formatted values.
Thanks
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: