BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

Hi all.  I run this same code only changing the first parameter of the INTCK function from "month" to "day" to "week".  For "month" it returns 12 as expected.  For "day" it returns 365 rows as expected.  But for "week" it returns 53 when I would expect 52.  Any reason I'd be getting this unexpected result?

 

proc sql;
create table tmp as
select distinct
1 + INTCK ("day", '01JUN2018'D, '31MAY2019'D) AS MY_NUMBER
FROM temp;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

A year, 365 or 366 days, is actually slightly longer than 52 weeks, which would be 52*7 = 364 days.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

A year, 365 or 366 days, is actually slightly longer than 52 weeks, which would be 52*7 = 364 days.

--
Paige Miller
buechler66
Barite | Level 11
Makes sense. Thank you.
PeterClemmensen
Tourmaline | Level 20

A year can not contain 53 full weeks, but there can be 53 week interval boundaries crossed in a full year, which is what the INTCK Function measures. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1143 views
  • 2 likes
  • 3 in conversation