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.

USRCON executes outside the BTS environment - it is not part of the SAL001 process that contains the Confirm activity. Figure 1 shows, in COBOL pseudocode, the USRCON program.
Figure 1. Pseudocode for the USRCON program, that implements the USRX transaction
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.
First, USRCON sends a map to the screen of the user and requests a unique reference. This reference must be the same as the key used by the CON001 program. This reference might be the customer reference or account number that has been used throughout to identify this instance of the Sale business transaction. However, it might need to be more specific than this. This would be the case if, for example:
  • The Sale business transaction has more than one user-related activity.
  • The user-related activity has defined more than one input event.
Using the unique reference, USRCON selects the appropriate record from the pending file. It then uses the value of Act-Id to acquire access to the Confirm activity for the SAL001 instance of the Sale business transaction:
 EXEC CICS ACQUIRE ACTIVITYID(Act-Id)
RESP(data-area) RESP2(data-area) END-EXEC
If the ACQUIRE command is successful, USRCON has access to the containers of the Confirm activity. USRCON creates a data-container for the Confirm activity ( User ), and puts some confirmation details into it:
 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.

Finally, USERCON activates the Confirm activity again, checks whether it completes successfully, and ends:
 .
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.



dfhp9c0045.html | Timestamp icon Last updated: Monday, 5 June 2017