here i want to create timesheet for given date range no of working days 5 mon-fri sat and sun week off
in a month four weeks how to create dynamically
Fri | 1 | ||
04-06-2022 | 01/06/2022-03/06/2022 | Sat | 1 |
05-06-2022 | 01/06/2022-03/06/2022 | Sun | 1 |
06-06-2022 | 01/06/2022-03/06/2022 | Mon | 1 |
07-06-2022 | 01/06/2022-03/06/2022 | Tue | 1 |
08-06-2022 | 08/06/2022-14/06/2022 | Wed | 2 |
09-06-2022 | 08/06/2022-14/06/2022 | Thu | 2 |
10-06-2022 | 08/06/2022-14/06/2022 | Fri | 2 |
11-06-2022 | 08/06/2022-14/06/2022 | Sat | 2 |
12-06-2022 | 08/06/2022-14/06/2022 | Sun | 2 |
13-06-2022 | 08/06/2022-14/06/2022 | Mon | 2 |
14-06-2022 | 08/06/2022-14/06/2022 | Tue | 2 |
15-06-2022 | 15-06-2022-21/06/2022 | Wed | 3 |
16-06-2022 | 15-06-2022-21/06/2022 | Thu | 3 |
17-06-2022 | 15-06-2022-21/06/2022 | Fri | 3 |
18-06-2022 | 15-06-2022-21/06/2022 | Sat | 3 |
19-06-2022 | 15-06-2022-21/06/2022 | Sun | 3 |
20-06-2022 | 15-06-2022-21/06/2022 | Mon | 3 |
21-06-2022 | 15-06-2022-21/06/2022 | Tue | 3 |
22-06-2022 | 22/06/2022-28/06/2022 | Wed | 4 |
23-06-2022 | 22/06/2022-28/06/2022 | Thu | 4 |
24-06-2022 | 22/06/2022-28/06/2022 | Fri | 4 |
25-06-2022 | 22/06/2022-28/06/2022 | Sat | 4 |
26-06-2022 | 22/06/2022-28/06/2022 | Sun | 4 |
27-06-2022 | 22/06/2022-28/06/2022 | Mon | 4 |
28-06-2022 | 22/06/2022-28/06/2022 | Tue | 4 |
29-06-2022 | 29/06/2022-30/06/2022 | Wed | |
30-06-2022 | 29/06/2022-30/06/2022 | Thu |
What is the logic that creates the first 4 days into group 1, and then everything groups by 7 days, and then the last two days of the month have no group? What is the logic that in the second column, the first "week" is only 3 days 01/06/2022-03/06/2022? Then June 4 through June 7 not part of any week in the second column, what is that logic?
You can't have a variable named 1 and then two columns with no variable name.
I'm sure you know this already, so it is disturbing and unacceptable that I even have to mention it, but data should be provided as working SAS data step code.
Please post your source dataset as a working data step with datalines., so we can know which variables you have (and their attributes), and what the code needs to create.
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 25. Read more here about why you should contribute and what is in it for you!
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.