Managing Customer Data (CUSTCTRL)
The CUSTCTRL program is responsible for managing customer data within the banking application. It retrieves the number of customers from a VSAM file, displays the retrieved data, and exits the program gracefully. This is achieved through a series of operations including initializing required codes, performing CICS READ operations, and handling system ID errors.
The flow starts with initializing the required sort code, then retrieves the number of customers from the VSAM file, displays the output data, and finally exits the program. The program handles system ID errors by retrying the read operation up to 100 times with a delay.
Lets' zoom into the flow:
Initializing the Required Sort Code
First, the PREMIERE
REQUIRED-SORT-CODE
SORTCODE
PREMIERE SECTION.
P010.
MOVE SORTCODE TO
REQUIRED-SORT-CODE.
Retrieving Number of Customers from VSAM
Next, the program performs the GET-NUMBER-OF-CUSTOMERS-VSAM
DFHCOMMAREA
PERFORM GET-NUMBER-OF-CUSTOMERS-VSAM
GET-NUMBER-OF-CUSTOMERS-VSAM
GET-NUMBER-OF-CUSTOMERS-VSAM
The GET-NUMBER-OF-CUSTOMERS-VSAM
DFHCOMMAREA
GET-NUMBER-OF-CUSTOMERS-VSAM SECTION.
WCV010.
INITIALIZE DFHCOMMAREA.
MOVE ZERO TO CUSTOMER-CONTROL-SORTCODE
MOVE ALL '9' TO CUSTOMER-CONTROL-NUMBER
EXEC CICS READ
FILE('CUSTOMER')
INTO(DFHCOMMAREA)
RIDFLD(CUSTOMER-CONTROL-KEY)
KEYLENGTH(16)
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC.
if ws-cics-resp = dfhresp(sysiderr)
perform varying SYSIDERR-RETRY from 1 by 1
Displaying Output Data
Then, the program displays the output data stored in DFHCOMMAREA
D DISPLAY 'OUTPUT DATA IS='
D DFHCOMMAREA.
Exiting the Program
Finally, the program performs the 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.
GMOFH010.
EXEC CICS RETURN
END-EXEC.
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human