Script is the only option. By the way "fancy" coding is very strait forward in this case. Here is the real power of implementing virtually any schedules. Create new user-defined statement (Script Library) that returns next busness day for any given date. Then create new job of script ype that checks for 2nd, 9th, 17th, and 25th day and runs your program ================================================= Here is the template for the job: Dim time_to_run, boolean // isNextBusDay - name of the user-defined statement isNextBusDay 1, time_to_run ifThen time_to_run, RUN_PROGRAM isNextBusDay 8, time_to_run ifThen time_to_run, RUN_PROGRAM isNextBusDay 16, time_to_run ifThen time_to_run, RUN_PROGRAM isNextBusDay 24, time_to_run ifThen time_to_run, RUN_PROGRAM RUN_PROGRAM: Dim process_id, number Run "myprogram.exe", "", process_id ================================================= Here is the template for the user-defined statement isNextBusDay: Declare new statement with 1 parameter (start_day as number) and return type as boolean Dim today, date Dim bus_day, date Dim bad_day, boolean Dim day_number, number // Get today's date Today today // if today is before or same as the specified start date then return False Day today, day_number isLessOrEqual day_number, start_day, bad_day ifThen bad_day, NOT_GOOD // calc. date for the specified start day as today minus today's day number // to adjust to the month start and then plus start day to adjust to the // specified day Multiply day_number, -1, day_number DateAdd today, day_number, bus_day DateAdd bus_day, start_day, bus_day // find first business day, go day by day till find good one TRY_NEXT: DateAdd bus_day, 1, bus_day // weekned ? isWeekend bus_day, bad_day ifThen bad_day, TRY_NEXT // holiday ? isHoliday bus_day, bad_day ifThen bad_day, TRY_NEXT // if today is not the same as next bus. then skip today NotIsEqual today, bus_day, bad_day ifThen bad_day, NOT_GOOD // ok, it's time to do the job Return True NOT_GOOD: // bad day Return False ================================================= Enjoy! PS. I didn't try this, you may need to do some fixing : I need to schedule a process to run on first business day after the 1st, 8th, : 16th, and 24th. Is there a way to do this in Scheduler when setting up a : job, or will I have to do some sort of fancy coding within the script?
|