DATA Step, Macro, Functions and more

Sunday to Saturday work day

Accepted Solution Solved
Reply
Contributor
Posts: 61
Accepted Solution

Sunday to Saturday work day

I would like to create my work day as (Sunday to Saturday) range data. could you please help in getting this?

 

thanks,

Siva


Accepted Solutions
Solution
‎03-06-2017 07:19 AM
Super User
Posts: 19,770

Re: Sunday to Saturday work day

Posted in reply to sivastat08

Use INTNX with WEEK interval. 

 

Week_start = intnx('week', date, 0, 'b');

week_end = Intnx('week', date, 0, 'e');

 

or the week function

 

week_num = week(date, 'u');

 

Links to documentation

Intnx

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p10v3sa3i4k...

 

Week

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n1ka2ulrvrj...

 

View solution in original post


All Replies
Super User
Posts: 19,770

Re: Sunday to Saturday work day

Posted in reply to sivastat08

What does that mean?

Contributor
Posts: 61

Re: Sunday to Saturday work day

i have a one year data, i want weekly split (5thMar2017(Sunday)) -(11thMar2017(Saturday)

for example if i take today (5thMar2017) that should come under "05Mar-11Mar" in seperate column in SAS
Solution
‎03-06-2017 07:19 AM
Super User
Posts: 19,770

Re: Sunday to Saturday work day

Posted in reply to sivastat08

Use INTNX with WEEK interval. 

 

Week_start = intnx('week', date, 0, 'b');

week_end = Intnx('week', date, 0, 'e');

 

or the week function

 

week_num = week(date, 'u');

 

Links to documentation

Intnx

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p10v3sa3i4k...

 

Week

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#n1ka2ulrvrj...

 

Contributor
Posts: 61

Re: Sunday to Saturday work day

Thanks for Quick replay and Document.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 128 views
  • 1 like
  • 2 in conversation