I have a timer task triggered every 5 mins which invokes a Cobol program. The timer task starts correctly.
The program then does a DC RETURN NEXT TASK CODE 'TASK2' but the task is never executed.
DC RETURN NEXT TASK CODE doesn't work for a background task because there is no terminal where we would normally display the ENTC prompt.
As an alternative, code another SET TIMER START with a delay of 1 second instead of the DC RETURN NEXT TASK CODE.
SET TIMER START INTERVAL TIME-1-SECOND TASK CODE 'TASK2' PRIORITY 240.
The work field would be defined as:
03 TIME-1-SECOND PIC S9(8) COMP VALUE 1.