Recently, we scheduled two tasks (1008 and 1009) within Task Manager. Task ID 1008 is set to run after Purge Tasks (%SYS-ID:3), and Task 1009 is set to run at 7:00:00 each day.
In attempt to provide as much detail as possible, each of the tasks are as follows:
- Task 1008
WHILE (($p($h,",",2) < $ZTH("10:00 PM")) && ($P($g(^Task.1008(+$h,$j)),"^",1) = +$h)) { J ^ROUTINE, ^ROUTINE2 D SUB^ROUTINE3 H 5 }
- Task 1009
WHILE (($p($h,",",2) < $ZTH("10:00 PM")) && ($P($g(^Task.1009(+$h,$j)),"^",1) = +$h)) { d ^ROUTINE4, ^ROUTINE5 J SUB^ROUTINE6 }
The two tasks both reach an UNDEFINED error, which seems rather odd. The following are the email messages I receive from Caché with the subject line, "Scheduler process - failed".
Scheduler process Task 1008 - 1008 Scheduled for 2017-09-23 12:03, failed Executing Code %SYS.Task.RunLegacyTask at 2017-09-25 06:56 <UNDEFINED>zexecuteCode+4^%SYS.Task.RunLegacyTask.1 *Status
Scheduler process Task 1009 - 1009 Scheduled for 2017-09-24 07:00, failed Executing Code %SYS.Task.RunLegacyTask at 2017-09-25 06:55 <UNDEFINED>zexecuteCode+4^%SYS.Task.RunLegacyTask.1 *Status
How do I go about fixing the UNDEFINED error that is being encountered so that this does not occur every day? We end up having to manually start the tasks each day.