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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 871 views
  • 0 likes
  • 2 in conversation