Transferring Funds (XFRFUN)
The XFRFUN program handles the transfer of funds within the banking application. It starts by setting up the environment, validating the transaction amount, updating the account in the DB2
The flow starts with setting up the environment for the transaction, then checks if the transaction amount is valid. If the amount is valid, it updates the account in the DB2
Where is this program used?
This program is used once, in a flow starting from BNK1TFN
as represented in the following diagram:
Lets' zoom into the flow:
Start Premiere Transaction
The PREMIERE
PREMIERE SECTION.
A010.
EXEC CICS HANDLE ABEND
LABEL(ABEND-HANDLING)
END-EXEC.
MOVE '0' TO HV-ACCOUNT-EYECATCHER.
MOVE '0' TO HV-ACCOUNT-SORTCODE.
MOVE '0' TO HV-ACCOUNT-ACC-NO.
MOVE 0 TO DB2-DEADLOCK-RETRY.
Validate Transaction Amount
The code checks if the transaction amount (COMM-AMT
GET-ME-OUT-OF-HERE
* If the amount being transferred is negative, then
* flag this as a failure and finish.
*
IF COMM-AMT <= ZERO
MOVE 'N' TO COMM-SUCCESS
MOVE '4' TO COMM-FAIL-CODE
PERFORM GET-ME-OUT-OF-HERE
END-IF.
Update Account in DB2
DB2
If the transaction amount is valid, the code proceeds to update the account in the DB2
UPDATE-ACCOUNT-DB2
PERFORM UPDATE-ACCOUNT-DB2
Exit Transaction
Finally, the code exits the transaction by performing GET-ME-OUT-OF-HERE
PERFORM GET-ME-OUT-OF-HERE.
GET-ME-OUT-OF-HERE
GET-ME-OUT-OF-HERE
The GET-ME-OUT-OF-HERE
GET-ME-OUT-OF-HERE SECTION.
GMOOH010.
EXEC CICS RETURN
END-EXEC.
GOBACK.
GMOOH999.
EXIT.
UPDATE-ACCOUNT-DB2
UPDATE-ACCOUNT-DB2
The UPDATE-ACCOUNT-DB2
DB2
UPDATE-ACCOUNT-DB2 SECTION.
UAD010.
MOVE 'N' TO COMM-SUCCESS.
*
* Are we trying to transfer from and to the same account?
* We don't allow that.
*
IF COMM-FACCNO = COMM-TACCNO
AND COMM-FSCODE = COMM-TSCODE
*
* Preserve the RESP and RESP2, then set up the
* standard ABEND info before getting the applid,
* date/time etc. and linking to the Abend Handler
* program.
*
INITIALIZE ABNDINFO-REC
MOVE EIBRESP TO ABND-RESPCODE
MOVE EIBRESP2 TO ABND-RESP2CODE
*
* Get supplemental information
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human