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!
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?
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.