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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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: