Skip to main content

Updating Account Information (UPDACC)

The UPDACC program is responsible for updating account information in the database. It is initiated by the BNK1UAC program and follows a specific flow to ensure the account details are correctly updated. The process starts with identifying the account using the SORTCODE, updating the necessary fields, and then ending the program.

The flow starts with the BNK1UAC program calling the UPDACC program. The UPDACC program begins by identifying the account to be updated using the SORTCODE. It then updates the account information in the database, ensuring all fields are valid. Finally, the program ends and returns control to the calling program.

Where is this program used?

This program is used once, in a flow starting from BNK1UAC as represented in the following diagram:

Lets' zoom into the flow:


PREMIERE Section

The PREMIERE section is responsible for initiating the process of updating account information. It starts by moving the SORTCODE to COMM-SCODE and DESIRED-SORT-CODE, which are used for identifying the account to be updated. Then, it performs the UPDATE-ACCOUNT-DB2 section to update the account information in the database. Finally, it performs the GET-ME-OUT-OF-HERE section to end the program.

       PREMIERE SECTION.
A010.

MOVE SORTCODE TO COMM-SCODE.
MOVE SORTCODE TO DESIRED-SORT-CODE.

*
* Update the account information
*
PERFORM UPDATE-ACCOUNT-DB2

*
* The COMMAREA values have now been set so all we need to do
* is finish
*

PERFORM GET-ME-OUT-OF-HERE.

A999.
EXIT.


UPDATE-ACCOUNT-DB2 Section

The UPDATE-ACCOUNT-DB2 section handles the actual update of the account information in the database. It starts by positioning itself at the matching account record using the SORTCODE and ACCOUNT_NUMBER. It then checks if the read was successful. If not, it marks the return field as not successful and exits. If the read was successful, it updates the account record with the new information provided. It also ensures that the account type, interest rate, and overdraft limit are valid before updating. Finally, it sets the success code if the update was successful.

       UPDATE-ACCOUNT-DB2 SECTION.
UAD010.

*
* Position ourself at the matching account record
*

MOVE COMM-ACCNO TO DESIRED-ACC-NO.
MOVE DESIRED-SORT-CODE TO HV-ACCOUNT-SORTCODE.
MOVE DESIRED-ACC-NO TO HV-ACCOUNT-ACC-NO.

EXEC SQL
SELECT ACCOUNT_EYECATCHER,
ACCOUNT_CUSTOMER_NUMBER,
ACCOUNT_SORTCODE,
ACCOUNT_NUMBER,
ACCOUNT_TYPE,
ACCOUNT_INTEREST_RATE,
ACCOUNT_OPENED,
ACCOUNT_OVERDRAFT_LIMIT,
ACCOUNT_LAST_STATEMENT,


GET-ME-OUT-OF-HERE Section

The GET-ME-OUT-OF-HERE section is responsible for ending the program. It executes the CICS RETURN command to return control to the calling program.

       GET-ME-OUT-OF-HERE SECTION.
GMOOH010.

EXEC CICS RETURN
END-EXEC.

GMOOH999.
EXIT.

 

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