I can suggest 2 methods Method 1. In the existing job, when the file is found you should first move it somewhere so that it cannot be found in the same place. Create new job with daily schedule starting at 4:00 or a bit later and check date/time of that file. If the file date is less then today then RUN_JOBS as you have it now, otherwise simply exit. To get file date use FileDate, for example, Dim fdate, date Dim old_file, boolean FileDate("path_to_file\\file_name", fdate) isLess(fdate, @T"mm/dd/yyyy", old_file) ... fork logic based on old_file value ... Method 2. Create new job with daily schedule starting at 4:00 and set this job to start tomorrow. Make it to run RUN_JOBS as you have it now in the existing job. In the existing job right before RUN_JOBS add a line to update start time of the 4:00 job to tomorrow. This way if the file arrives in time the other job gets automatically pushed/rescheduled to the next day. This repeats everyday unless the file is late or never received. To update the other job start date, do something like JobModify("id of the new job here", "START_DATE", "@DN"mm/dd/yyyy"") This method seems to be a lot easier to code but a bit harder to understand. I suggest if you choose it, enter some descriptive comments into both jobs so other people and you later can figure out who these jobs work together. : Currently I have a job set up to watch for a notification file and then have : the following script run to make sure it has arrived in the specified : valid window. : Dim today, date : Dim time_now, time : Dim valid_time, boolean : CHECK_TIME: Now( time_now ) : isTimeBetween( time_now, 1:00, 4:00, valid_time ) : If( valid_time, RUN_JOBS, OUTSIDE_WINDOW ) : RUN_JOBS: : JobRun( "Insert Rev Exp" ) : JobRun( "Delete Rev Exp" ) : JobRun( "WellTest" ) : Exit : OUTSIDE_WINDOW: Exit : I now realize if no file arrives by 4:00 I need to run the job anyway. Do you : have any suggestions on the best way to handle this in 24x7? : Thanks, : Jeff
|