Implementation of a user-related activity
You can use the Confirm activity to notify the Sale business transaction that actual delivery has taken place. In the COBOL pseudocode for program CON001, you can see how it implements the Confirm user-related activity.
Figure 1. Pseudocode for the CON001
program, that implements the Confirm activity (Part 1)
Identification Division.
Program-id. CON001
Environment Division.
Data Division.
Working-Storage Section.
01 RC pic s9(8) comp.
01 Event-Name pic x(16).
88 DFH-Initial value 'DFHINITIAL'
88 User-Ready value 'User-Ready'.
01 Data-Record.
03 User-Reference pic x(60).
03 Act-Id pic x(52).
03 Usr-Event pic x(16).
01 Data-Record-Len pic s9(8) comp..
01 Delivery-Container pic x(16) value 'Delivery'.
01 User-Container pic x(16) value 'User'.
01 Confirm-Container pic x(16) value 'Confirm'.
01 Delivery-Details.
03 Deliv-Details ..
03 User-Details ...
Linkage Section.
01 DFHEIBLK..
Procedure Division.
In-The-Beginning..
EXEC CICS RETRIEVE REATTACH EVENT(Event-Name)
RESP(RC) END-EXEC.
If RC NOT = DFHRESP(NORMAL).
End-If..
Evaluate True
When DFH-Initial
Perform Initialization
When User-Ready
Perform Do-Work
When Other.
End Evaluate..
EXEC CICS RETURN END-EXEC.
Initialization..
EXEC CICS DEFINE INPUT EVENT(User-Ready)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS ASSIGN ACTIVITYID(Act-Id)
RESP(data-area) RESP2(data-area) END-EXEC.
MOVE User-Ready TO Usr-Event
MOVE LENGTH OF Data-Record TO Data-Record-Len
.
Figure 2. Pseudocode for the CON001 program,
that implements the Confirm activity (Part 2)
EXEC CICS WRITE FILE('PENDING')
FROM(Data-Record) LENGTH(Data-Record-Len)
RIDFLD(User-Reference)
RESP(data-area) RESP2(data-area) END-EXEC.
Do-Work..
Merge contents of two input data-containers into Delivery-Details.
EXEC CICS GET CONTAINER(Delivery-Container)
INTO(Deliv-Details)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS GET CONTAINER(User-Container)
INTO(User-Details)
RESP(data-area) RESP2(data-area) END-EXEC.
Set up the output data-container.
EXEC CICS PUT CONTAINER(Confirm-Container)
FROM(Delivery-Details)
RESP(data-area) RESP2(data-area) END-EXEC.
Clean up.
EXEC CICS DELETE FILE('PENDING') RIDFLD(User-Reference)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS DELETE EVENT(User-Ready)
RESP(data-area) RESP2(data-area) END-EXEC.
End the activity.
EXEC CICS RETURN ENDACTIVITY
RESP(data-area) END-EXEC.
End Program.