BookmarkSubscribeRSS Feed
smal613003
Calcite | Level 5

Hi everyone

I am trying to create a scheduling program (to help figure out when members of an organization can volunteer), and I'm running into one major problem. The volunteers have submitted a form that includes how many days of the week they are available. I can't figure out how to account for when the volunteers have reached their maximum desired volunteer days. For example, lets assume my final table looks like this:

Time Slot     Name     Number of Days Available

Monday       Sam          1

Tuesday      John          2

Wednesday Sam          1

I want my program to eliminate Sam for the Wednesday time slot because he only wants to volunteer one day a week and has already volunteered on Monday. My initial instinct was to create an additional variable that decreases "number of days available" by 1 every time a particular name appears. Then I could add a 'where' clause and remove negatives. I couldn't figure out how to do that though.

Thanks in advance!

2 REPLIES 2
ballardw
Super User

It often helps to start with what the raw data looks like  and then describe the result.

I would also suspect that you may have days where you may want the day he works to be one that does not already have sufficient volunteers. Is that the case here?

I suspect that one of the SAS/OR procedures might be what you want for an optimization problem. Do you have access to SAS/OR?

smal613003
Calcite | Level 5

Thanks for the help. I'm not sure if I have SAS/OR. I was able to figure out a solution to my problem by creating an additional variable that had a value of 1 for each day of the week. I associated it with the original data by joining with the name of the person, and at the end I subtracted out all of the 1s (I had to add a condition "if null then 0" to make it work) to get what I needed.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 759 views
  • 3 likes
  • 2 in conversation