Skip to main content

Retrieving Account (INQACC)

The INQACC program is responsible for inquiring account details in the banking system. It initializes output data, sets up abend handling, processes the account number, retrieves account information from the database, and returns the account data to the COMMAREA. The program ensures that all fields are set to their default values before processing begins and handles any abnormal terminations properly.

The INQACC program starts by initializing the output data and setting up abend handling to manage any errors. It then checks the account number and retrieves the account information from the database. The retrieved data is returned to the COMMAREA, and the program sets a success flag based on the account type. Finally, the program performs the GET-ME-OUT-OF-HERE operation to return control back to CICS.

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:


Initialize Output Data

First, the program initializes the output data to ensure that all fields are set to their default values before processing begins.

           INITIALIZE OUTPUT-DATA.


Set Up Abend Handling

Next, the program sets up abend handling using the CICS HANDLE ABEND command to ensure that any abnormal terminations are properly managed.

           EXEC CICS HANDLE
ABEND LABEL(ABEND-HANDLING)
END-EXEC.


Move Sort Code to Required Sort Code

Then, the program moves the sort code to the required sort code field in the account key structure, preparing it for the database query.

           MOVE SORTCODE TO REQUIRED-SORT-CODE OF ACCOUNT-KY.


Check Account Number

The program checks if the account number is 99999999. If it is, it performs the READ-ACCOUNT-LAST operation; otherwise, it performs the READ-ACCOUNT-DB2 operation to retrieve the account information from the database.

           IF INQACC-ACCNO = 99999999
PERFORM READ-ACCOUNT-LAST
ELSE
PERFORM READ-ACCOUNT-DB2
END-IF


Return Account Data to COMMAREA

The program then returns the account data to the COMMAREA. If the account type is spaces or low values, it sets the success flag to 'N'. Otherwise, it moves the account data to the corresponding fields in the COMMAREA and sets the success flag to 'Y'.

           IF ACCOUNT-TYPE = SPACES OR LOW-VALUES
MOVE 'N' TO INQACC-SUCCESS
ELSE
MOVE ACCOUNT-EYE-CATCHER TO INQACC-EYE
MOVE ACCOUNT-CUST-NO TO INQACC-CUSTNO
MOVE ACCOUNT-SORT-CODE TO INQACC-SCODE
MOVE ACCOUNT-NUMBER TO INQACC-ACCNO
MOVE ACCOUNT-TYPE TO INQACC-ACC-TYPE
MOVE ACCOUNT-INTEREST-RATE TO INQACC-INT-RATE
MOVE ACCOUNT-OPENED TO INQACC-OPENED
MOVE ACCOUNT-OVERDRAFT-LIMIT TO INQACC-OVERDRAFT
MOVE ACCOUNT-LAST-STMT-DATE TO INQACC-LAST-STMT-DT
MOVE ACCOUNT-NEXT-STMT-DATE TO INQACC-NEXT-STMT-DT
MOVE ACCOUNT-AVAILABLE-BALANCE TO INQACC-AVAIL-BAL
MOVE ACCOUNT-ACTUAL-BALANCE TO INQACC-ACTUAL-BAL
MOVE 'Y' TO INQACC-SUCCESS
END-IF.


Perform GET-ME-OUT-OF-HERE

Finally, the program performs the GET-ME-OUT-OF-HERE operation to return control back to CICS.

           PERFORM GET-ME-OUT-OF-HERE.

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human