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. 

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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