BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
amiller9702
Calcite | Level 5

Hello!

I am working with some data to calculate FTE hours based off business days in a given month (excluding weekends and standard US holidays). 

My data is layed out as follows - 

For example

PRID

ProjectID

ResourceID

AllocYear

AllocJan

AllocFeb

AllocMar

AllocApr

AllocMay

AllocJun

AllocJul

AllocAug

AllocSep

AllocOct

AllocNov

AllocDec

6002198

5728091

5181017

2017

32

32

36.8

32

35.2

35.2

16

0

0

0

0

0

I need to determine based off the current date(7/20/17) - what is the correct month variable to use(AllocJul) and what year (AllocYear) to use.

 and then calculate the percentage of FTE hours based on the following

Business days in current month (July 2017 has 20 days) and multiply that (20 *8) 8 being the standard number of hours a full time FTE works per day and then divide that by the number in the current Alloc month column.

 

 

It would be (20*8) = 160  and 16 for AllocJul in the example above

Would be 160/16 = 10

 

Is there a way in sas to do this?

Thank you in advance for your help!

Angie Miller

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Use an Array:

data want (keep=prid projectid resourceid alloc);
set have;
where allocyear = year(today);
array months {*} allocjan-allocdec;
alloc = months{month(today())};
run;

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

Use an Array:

data want (keep=prid projectid resourceid alloc);
set have;
where allocyear = year(today);
array months {*} allocjan-allocdec;
alloc = months{month(today())};
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 849 views
  • 0 likes
  • 2 in conversation