Next Task Code not Invoked in Timer Task

Document ID : KB000091684
Last Modified Date : 16/04/2018
Show Technical Document Details
Issue:
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.
 
Resolution:
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.
For example:
SET TIMER START INTERVAL TIME-1-SECOND TASK CODE 'TASK2' PRIORITY 240.
DC RETURN.

The work field would be defined as:
   03 TIME-1-SECOND PIC S9(8) COMP VALUE 1.