What would be the result of the following SAS function (given that 31 Dec 2017 is Saturday)? Weeks = intck (‘week’,’31 dec 2017’d,’01jan2018’d); Years = intck (‘year’,’31 dec 2017’d,’01jan2018’d); Months = intck (‘month’,’31 dec 2017’d,’01jan2018’d);

Here, we will calculate the weeks between 31st December 2017 and 1st January 2018. 31st December 2017 was a Saturday. So 1st January 2018 will be a Sunday in the next week.

  • Hence, Weeks = 1 since both the days are in different weeks.
  • Years = 1 since both the days are in different calendar years.
  • Months = 1 since both the days are in different months of the calendar.