BookmarkSubscribeRSS Feed
cr4
Calcite | Level 5 cr4
Calcite | Level 5
Hi, I am still fairly new to SAS and can do most of your basic tests and codes. I am an intern at a company and am working on a school project that involves the company, and am having trouble with PROC OPTMODEL. Thought I could teach myself, but it’s a bit harder than I realized. I am attaching a very short modified dataset as an example of what I am trying to do with a larger dataset. I’d like to start small, and learn how to add more constraints to my larger model myself. But I can’t even get a basic code to run. I’m trying to optimize a schedule for efficiency. (Later, I’d use cost, etc). I have three people in the data set that need to work 3 days, 8 hour shifts, when available (1). I am attaching what I have so far. Any help or sample code so I could get a base start would be very much appreciated! Thank you!
1 REPLY 1
RobPratt
SAS Super FREQ

The simplest way to get your code working is to make the following changes.

 

1. Change the declaration of two sets:

    set <str> GUARDS;
    set <str> SHIFTS;

2. Replace the READ DATA statement:

    read data guard_availability into GUARDS=[Guard];
    read data guard_availability into SHIFTS=[Shift];
    read data guard_availability into DATES=[Date];
    read data guard_availability into [Guard Shift Date]
        Available Hours;

3. Change the CREATE DATA statement:

    create data schedule from [Guard Shift Date] Assigned=x;

You might find this book of examples useful:

SAS Help Center: SAS/OR® User's Guide: Mathematical Programming Examples

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Discussion stats
  • 1 reply
  • 1239 views
  • 3 likes
  • 2 in conversation