08-15-2015 07:24 PM
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!
08-17-2015 12:01 PM
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?
08-21-2015 11:39 PM
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.