BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5
Diff=intck('week','31dec2018'd,'01jan2019'd,'c');

Diff1=intck('week','31dec2018'd,'01jan2019'd,'d');

If I use above code I am getting '0' for both variables .
Can you explain?
4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

 

These dates are a Monday and a Tuesday, so are in the same week.

 

Note that weeks start on Sunday -not Monday- in the crazy world of SAS week functions (might be a US thing).

 

Use 'week.2' to start the week en Monday. 

 

Finally, the 'c' parameter shifts the start of the week to the first date.

 

thanikondharish
Calcite | Level 5
Thanq .I understood
SASKiwi
PROC Star

The INTCK function only counts whole intervals. The "C" - continuous - option counts whole weeks so until you have 7 days between the start and end date the result will be 0. The "D" - discrete option counts interval boundaries. By default the WEEK boundary is Saturday to Sunday. Your dates cover Monday to Tuesday so they don't cover a week boundary, so the result is also 0.

thanikondharish
Calcite | Level 5
Thanq.I understood

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 544 views
  • 1 like
  • 3 in conversation