The ATTACH statement instructs the system to initiate a new task by acquiring the necessary control blocks and storage and by adding the task to its dispatching list. The system initializes the attached task and queues it for execution. The issuing program receives control according to normal dispatching priority.
►►─── ATTACH TASK CODE (task-code) ─┬───────────────────────┬─┬──────────┬ ; ─►◄ └─ PRIORITY (priority) ─┘ ├─ WAIT ◄ ─┤ └─ NOWAIT ─┘
Specifies the 1- to 8-character code of the task to be initiated. Task-code is the symbolic name of a user-defined field containing the task code or the task code itself, enclosed in single quotation marks. The referenced task code must have been defined during system generation or dynamically, by using the DCMT VARY DYNAMIC TASK command.
Note: For more information about DCMT VARY DYNAMIC TASK, see the CA IDMS System Tasks and Operator Commands Guide.
Specifies the dispatching priority of the attached task. Priority can be the symbolic name of a user-defined fixed binary field containing the dispatching priority, or a numeric constant. Valid priorities are numeric values ranging from 000 through 240. Priority defaults to the priority established during system generation for the specified task code, terminal, and user.
Specifies whether the issuing task waits if a maximum task condition prevents the system from attaching the task immediately:
Specifies that the issuing task waits until the maximum task condition no longer exists and the system can attach the specified task. WAIT is the default.
Specifies that the issuing task does not wait for the system to attach the task. If you specify NOWAIT, your program should check the ERROR_STATUS field in the IDMS DC communications block to determine whether the ATTACH request completed. If ERROR_STATUS contains the value 3711, indicating that a maximum task condition exists, then the request was not serviced and your program should perform alternative processing before reissuing the ATTACH request.
The following code initiates task TASKATCH and assigns the task a dispatching priority of 199:
ATTACH TASK CODE (TASKATCH) PRIORITY (199) NOWAIT;
Upon completion of the ATTACH function, the ERROR_STATUS field of the IDMS DC communications block indicates the outcome of the operation:
The request was serviced successfully.
The task cannot be attached because the maximum number of tasks has already been attached.
The specified task code is not defined to the DC/UCF system.
The task cannot be attached because the maximum number of concurrent task threads was exceeded.
The requested task could not be attached because the current user is not authorized to execute the task.
|
Copyright © 2014 CA.
All rights reserved.
|
|