The USRX user transaction
When ready to confirm delivery, the user starts the USRX user-written transaction, which starts the USRCON program. You can step through the USRCON pseudocode to see how conformation takes place.
Identification Division.
Program-id. USRCON.
Environment Division.
Data Division.
Working-Storage Section.
01 Pending-Record.
03 User-Reference pic x(60).
03 Act-Id pic x(52).
03 Usr-Event pic x(16)..
01 User-Container pic x(16) value 'User'.
01 Confirmation-Details.
03 ...
Linkage Section.
01 DFHEIBLK..
01 DFHCOMMAREA.
.
Procedure Division using DFHEIBLK DFHCOMMAREA.
In-The-Beginning..
EXEC CICS SEND MAP('......') MAPSET('......') ....
EXEC CICS RECEIVE MAP('......') MAPSET('......) ...
Move ..unique.. to User-Reference..
EXEC CICS READ FILE('PENDING')
INTO(Pending-Record) RIDFLD(User-Reference)
RESP(data-area) RESP2(data-area) END-EXEC.
. Acquire access to the Confirm activity of the SAL001 process.
EXEC CICS ACQUIRE ACTIVITYID(Act-Id)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS PUT CONTAINER(User-Container)
ACQACTIVITY
FROM(Confirmation-Details)
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS RUN ACQACTIVITY
INPUTEVENT(Usr-Event)
SYNCHRONOUS
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS CHECK ACQACTIVITY COMPSTATUS(status)
RESP(RC) RESP2(data-area) END-EXEC.
If RC NOT = DFHRESP(NORMAL).
End-If..
If status NOT = DFHVALUE(NORMAL).
End-If..
EXEC CICS RETURN
RESP(data-area) END-EXEC.
End Program.
- The Sale business transaction has more than one user-related activity.
- The user-related activity has defined more than one input event.
EXEC CICS ACQUIRE ACTIVITYID(Act-Id)
RESP(data-area) RESP2(data-area) END-EXEC
EXEC CICS PUT CONTAINER(User-Container)
ACQACTIVITY
FROM(Confirmation-Details)
RESP(data-area) RESP2(data-area) END-EXEC
The ACQACTIVITY option associates the new User container with the activity that USERCON has acquired.
.
EXEC CICS RUN ACQACTIVITY
INPUTEVENT(Usr-Event)
SYNCHRONOUS
RESP(data-area) RESP2(data-area) END-EXEC.
EXEC CICS CHECK ACQACTIVITY COMPSTATUS(status)
RESP(RC) RESP2(data-area) END-EXEC.
EXEC CICS RETURN
RESP(data-area) END-EXEC
.
The value of the INPUTEVENT option of the RUN command is the name of the input event previously defined by the Confirm activity. Although USRCON can check whether the activity it has acquired completes successfully, the execution of the CHECK ACQACTIVITY command does not cause CICS to delete the completion event of the Confirm activity. CICS deletes a completion event of the completed activity only after the execution of a CHECK ACTIVITY command issued by the parent of the activity.