BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

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  
2 REPLIES 2
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Kurt_Bremser
Super User

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 2 replies
  • 246 views
  • 0 likes
  • 3 in conversation