Retrieving Customer Accounts (INQACCCU)
The INQACCCU program is responsible for inquiring about customer accounts. It is used in multiple parts of the system to retrieve and verify customer information. The program achieves this by performing a series of checks and database operations to ensure the customer exists and their account details are accurate.
The flow starts with initializing communication codes and setting up an ABEND handler. It then checks if the customer exists in the database. If the customer is not found, it exits the process. If the customer is found, it retrieves account information from the database and completes the transaction.
Where is this program used?
This program is used multiple times in the codebase as represented in the following diagram:
Lets' zoom into the flow:
Start PREMIERE Section
First, the PREMIERE
PREMIERE SECTION.
A010.
MOVE 'N' TO COMM-SUCCESS
MOVE '0' TO COMM-FAIL-CODE
EXEC CICS HANDLE ABEND
LABEL(ABEND-HANDLING)
END-EXEC.
MOVE SORTCODE TO REQUIRED-SORT-CODE OF CUSTOMER-KY.
Perform CUSTOMER-CHECK
CUSTOMER-CHECKNext, the CUSTOMER-CHECK
PERFORM CUSTOMER-CHECK.
CUSTOMER-CHECK Paragraph
CUSTOMER-CHECKThe CUSTOMER-CHECKCUSTOMER-FOUNDINQCUSTCUSTOMER-FOUND
More about INQCUST:
CUSTOMER-CHECK SECTION.
CC010.
*
* Retrieve customer information by linking to INQCUST
*
IF CUSTOMER-NUMBER IN DFHCOMMAREA = ZERO
MOVE 'N' TO CUSTOMER-FOUND
MOVE ZERO TO NUMBER-OF-ACCOUNTS
GO TO CC999
END-IF.
IF CUSTOMER-NUMBER IN DFHCOMMAREA = '9999999999'
MOVE 'N' TO CUSTOMER-FOUND
MOVE ZERO TO NUMBER-OF-ACCOUNTS
GO TO CC999
END-IF.
INITIALIZE INQCUST-COMMAREA.
MOVE CUSTOMER-NUMBER IN DFHCOMMAREA TO INQCUST-CUSTNO.
Check CUSTOMER-FOUND
CUSTOMER-FOUNDThen, the code checks if CUSTOMER-FOUNDGET-ME-OUT-OF-HERE
IF CUSTOMER-FOUND = 'N'
MOVE 'N' TO COMM-SUCCESS
MOVE '1' TO COMM-FAIL-CODE
PERFORM GET-ME-OUT-OF-HERE
END-IF
GET-ME-OUT-OF-HERE Paragraph
GET-ME-OUT-OF-HEREThe GET-ME-OUT-OF-HERE
GET-ME-OUT-OF-HERE SECTION.
GMOFH010.
*
* Return control back to CICS
*
EXEC CICS RETURN
END-EXEC.
GOBACK.
GMOFH999.
EXIT.
Perform READ-ACCOUNT-DB2
READ-ACCOUNT-DB2If the customer is found, the READ-ACCOUNT-DB2
PERFORM READ-ACCOUNT-DB2
READ-ACCOUNT-DB2 Paragraph
READ-ACCOUNT-DB2The READ-ACCOUNT-DB2DB2
READ-ACCOUNT-DB2 SECTION.
RAD010.
*
* Get accounts from account datastore
*
*
* Open the DB2 CURSOR
*
MOVE CUSTOMER-NUMBER IN DFHCOMMAREA TO HV-ACCOUNT-CUST-NO.
MOVE SORTCODE TO HV-ACCOUNT-SORTCODE.
EXEC SQL OPEN
ACC-CURSOR
END-EXEC.
MOVE SQLCODE TO SQLCODE-DISPLAY.
IF SQLCODE NOT = 0
MOVE SQLCODE TO SQLCODE-DISPLAY
Perform GET-ME-OUT-OF-HERE
GET-ME-OUT-OF-HEREFinally, the GET-ME-OUT-OF-HERE
PERFORM GET-ME-OUT-OF-HERE.
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human