Checking the response from a synchronous activity
The Order activity of the Sale application is created and run synchronously with SAL002.
About this task
Order-Activity..
EXEC CICS DEFINE ACTIVITY('Order')
TRANSID('SORD')
PROGRAM('ORD001')
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS PUT CONTAINER(Sale-Container)
ACTIVITY('Order') FROM(Process-Name)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS LINK ACTIVITY('Order')
RESP(data-area) RESP2(data-area) END-EXEC.
The RESP and RESP2 options on a RUN ACTIVITY or LINK ACTIVITY command return any exceptional condition that is raised during the processing of the command. However, what is processed is a request for BTS to run the activity—that is, for BTS to accept and schedule the activity. Therefore, the RESP and RESP2 options do not return any exceptional condition that might result from processing the activity itself.
- CHECK ACTIVITY(child_name)
- Used to check a child of the current activity.
- CHECK ACQACTIVITY
-
Used to check the activity that the current unit of work has
acquired
with an ACQUIRE ACTIVITYID command.
For information about acquiring activities, see Acquiring processes and activities.
Root activities are a special case. They are activated automatically by BTS after a RUN ACQPROCESS or LINK ACQPROCESS command is issued; also, they do not have completion events. To check the processing of a process, and therefore of a root activity, use the CHECK ACQPROCESS command.
EXEC CICS CHECK ACTIVITY('Order') COMPSTATUS(status)
RESP(RC) RESP2(data-area) END-EXEC.
If RC NOT = DFHRESP(NORMAL).
End-If..
If status NOT = DFHVALUE(NORMAL).
End-If.
.
Because Order is one of its child activities, SAL002 uses the CHECK ACTIVITY(child_name) form of the command.
The RESP and RESP2 options on the CHECK ACTIVITY command return a condition that tells you whether the CHECK command is understood by CICS® —for example, ACTIVITYERR occurs if an activity named Order has not been defined to SAL002.
- NORMAL is returned if the activity has completed all its processing steps.
- FORCED is returned if the activity was forced to complete with a CANCEL ACTIVITY command.
- INCOMPLETE is returned if the activity needs to be reactivated in order to complete all its processing steps.
- ABEND is returned if the program that implements the activity abended.
If a child activity completes, either successfully or unsuccessfully, and its parent issues a CHECK ACTIVITY command, the execution of the command causes CICS to delete the activity-completion event. Before a parent activity completes, it should ensure that the completion events of all its child activities have been deleted.
The firing of the completion event causes the parent of the activity to be activated. Only if the parent issues a CHECK ACTIVITY command does CICS delete the completion event.
For an explanation of why a program executing outside a process might want to acquire an activity within the process, see Interacting with BTS processes and activities . For an example of the use of the ACQUIRE ACTIVITYID and CHECK ACTIVITYID commands, see Activity processing.