Attached tasks typically perform support functions for the initiating task. For example, an attached task might perform print functions that can be requested by the user.
Steps to Attach a Task
To initiate a nonterminal task to be performed immediately:
Example of Attaching a Task
The program excerpt below initiates the nonterminal task DEPTPRNT if the user presses PA02.
PROGRAM-ID. GETMENU. DATA DIVISION.
WORKING-STORAGE SECTION.
01 DEPTPRNT PIC X(8) VALUE 'DEPTPRNT'.
PROCEDURE DIVISION.
BIND MAP SOLICIT.
BIND MAP SOLICIT RECORD SOLICIT-REC.
MAP IN USING SOLICIT.
INQUIRE MAP SOLICIT MOVE AID TO DC-AID-IND-V.
*** ATTACH TASK IF OPERATOR PRESSES PA02 ***
IF PA02-HIT
ATTACH TASK CODE DEPTPRNT
PRIORITY 100 NOWAIT
ON DC-MAX-TASKS GO TO MAP-OUT-ERR-MT.
.
*** INPUT PROCESSING ***
|
Copyright © 2013 CA.
All rights reserved.
|
|