Updating Account (BNK1UAC)
The BNK1UAC
The BNK1UAC
Here is a high level diagram of the program:
Evaluate User Input
Handling First Time Through
First, the code checks if it is the first time through by evaluating if EIBCALENBNK1UAOACCNOLSEND-ERASEWS-COMM-AREASEND-MAP
EVALUATE TRUE
*
* Is it the first time through? If so, send the map
* with erased (empty) data fields.
*
WHEN EIBCALEN = ZERO
MOVE LOW-VALUE TO BNK1UAO
MOVE -1 TO ACCNOL
SET SEND-ERASE TO TRUE
INITIALIZE WS-COMM-AREA
PERFORM SEND-MAP
Handling PA Key Presses
Moving to the next condition, if a PA key is pressed (EIBAIDDFHPA1DFHPA2DFHPA3
* If a PA key is pressed, just carry on
*
WHEN EIBAID = DFHPA1 OR DFHPA2 OR DFHPA3
CONTINUE
Handling PF3 Key Press
Next, if the PF3 key is pressed (EIBAIDDFHPF3
*
* When Pf3 is pressed, return to the main menu
*
WHEN EIBAID = DFHPF3
EXEC CICS RETURN
TRANSID('OMEN')
IMMEDIATE
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC
Handling AID or PF12 Key Presses
Then, if the AID or PF12 key is pressed (EIBAIDDFHAIDDFHPF12SEND-TERMINATION-MSG
* If the aid or Pf12 is pressed, then send a termination
* message.
*
WHEN EIBAID = DFHAID OR DFHPF12
PERFORM SEND-TERMINATION-MSG
EXEC CICS
RETURN
END-EXEC
Handling CLEAR Key Press
When the CLEAR key is pressed (EIBAIDDFHCLEAR
* When CLEAR is pressed
*
WHEN EIBAID = DFHCLEAR
EXEC CICS SEND CONTROL
ERASE
FREEKB
END-EXEC
EXEC CICS RETURN
END-EXEC
Handling ENTER or PF5 Key Presses
PF5When the ENTER or PF5EIBAIDDFHENTERDFHPF5PROCESS-MAP
* When enter is pressed then process the content
*
WHEN EIBAID = DFHENTER
PERFORM PROCESS-MAP
*
* When Pf5 is pressed then process the content
*
WHEN EIBAID = DFHPF5
PERFORM PROCESS-MAP
Handling Other Key Presses
Finally, for any other key presses, the code moves low values to BNK1UAOACCNOLSEND-DATAONLY-ALARMSEND-MAP
* When anything else happens, send the invalid key message
*
WHEN OTHER
MOVE LOW-VALUES TO BNK1UAO
MOVE 'Invalid key pressed.' TO MESSAGEO
MOVE -1 TO ACCNOL
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM SEND-MAP
END-EVALUATE.
Set Return Information
This is the next section of the flow.
Checking if EIBCALEN is not zero
First, we check if EIBCALEN
IF EIBCALEN NOT = ZERO
Moving COMM-EYE to WS-COMM-EYE
COMM-EYEWS-COMM-EYENext, we move the value of COMM-EYEWS-COMM-EYE
MOVE COMM-EYE TO WS-COMM-EYE
Moving COMM-CUSTNO to WS-COMM-CUSTNO
COMM-CUSTNOWS-COMM-CUSTNOMoving to the next step, we transfer the customer number from COMM-CUSTNOWS-COMM-CUSTNO
MOVE COMM-CUSTNO TO WS-COMM-CUSTNO
Moving COMM-SCODE to WS-COMM-SCODE
COMM-SCODEWS-COMM-SCODEThen, we move the service code from COMM-SCODEWS-COMM-SCODE
MOVE COMM-SCODE TO WS-COMM-SCODE
Moving COMM-ACCNO to WS-COMM-ACCNO
COMM-ACCNOWS-COMM-ACCNONext, we transfer the account number from COMM-ACCNOWS-COMM-ACCNO
MOVE COMM-ACCNO TO WS-COMM-ACCNO
Moving COMM-ACC-TYPE to WS-COMM-ACC-TYPE
COMM-ACC-TYPEWS-COMM-ACC-TYPEWe then move the account type from COMM-ACC-TYPEWS-COMM-ACC-TYPE
MOVE COMM-ACC-TYPE TO WS-COMM-ACC-TYPE
Moving COMM-INT-RATE to WS-COMM-INT-RATE
COMM-INT-RATEWS-COMM-INT-RATEMoving forward, we transfer the interest rate from COMM-INT-RATEWS-COMM-INT-RATE
MOVE COMM-INT-RATE TO WS-COMM-INT-RATE
Moving COMM-OPENED to WS-COMM-OPENED
COMM-OPENEDWS-COMM-OPENEDNext, we move the account opening date from COMM-OPENEDWS-COMM-OPENED
MOVE COMM-OPENED TO WS-COMM-OPENED
Moving COMM-OVERDRAFT to WS-COMM-OVERDRAFT
COMM-OVERDRAFTWS-COMM-OVERDRAFTWe then transfer the overdraft limit from COMM-OVERDRAFTWS-COMM-OVERDRAFT
MOVE COMM-OVERDRAFT TO WS-COMM-OVERDRAFT
Moving COMM-LAST-STMT-DT to WS-COMM-LAST-STMT-DT
COMM-LAST-STMT-DTWS-COMM-LAST-STMT-DTNext, we move the last statement date from COMM-LAST-STMT-DTWS-COMM-LAST-STMT-DT
MOVE COMM-LAST-STMT-DT TO WS-COMM-LAST-STMT-DT
Moving COMM-NEXT-STMT-DT to WS-COMM-NEXT-STMT-DT
COMM-NEXT-STMT-DTWS-COMM-NEXT-STMT-DTWe then transfer the next statement date from COMM-NEXT-STMT-DTWS-COMM-NEXT-STMT-DT
MOVE COMM-NEXT-STMT-DT TO WS-COMM-NEXT-STMT-DT
Moving COMM-AVAIL-BAL to WS-COMM-AVAIL-BAL
COMM-AVAIL-BALWS-COMM-AVAIL-BALNext, we move the available balance from COMM-AVAIL-BALWS-COMM-AVAIL-BAL
MOVE COMM-AVAIL-BAL TO WS-COMM-AVAIL-BAL
Moving COMM-ACTUAL-BAL to WS-COMM-ACTUAL-BAL
COMM-ACTUAL-BALWS-COMM-ACTUAL-BALFinally, we transfer the actual balance from COMM-ACTUAL-BALWS-COMM-ACTUAL-BAL
MOVE COMM-ACTUAL-BAL TO WS-COMM-ACTUAL-BAL
Return to CICS with COMMAREA
This is the next section of the flow.
Returning Control to CICS
First, the EXEC CICS RETURN
EXEC CICS
RETURN TRANSID('OUAC')
COMMAREA(WS-COMM-AREA)
LENGTH(99)
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC.
Setting Transaction ID
Next, the transaction ID is set to 'OUAC'. This ID is used by CICS to determine the next transaction to be executed.
RETURN TRANSID('OUAC')
Setting Communication Area
Then, the communication area (COMMAREAWS-COMM-AREA
COMMAREA(WS-COMM-AREA)
Setting Length
The length of the communication area is set to 99. This specifies the size of the data being passed.
LENGTH(99)
Setting Response Codes
Finally, the response codes (RESPRESP2WS-CICS-RESPWS-CICS-RESP2RETURN command execution.
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
Interim Summary
So far, we saw how the program evaluates user input and handles various key presses such as PA, PF3, AID, PF12, CLEAR, ENTER, and PF5
Error Handling
Check CICS Response
First, we check if the CICS response code WS-CICS-RESPDFHRESP(NORMAL)
IF WS-CICS-RESP NOT = DFHRESP(NORMAL)
Initialize ABNDINFO-REC
ABNDINFO-RECMoving to the next step, we initialize the ABNDINFO-RECEIBRESPEIBRESP2ABND-RESPCODEABND-RESP2CODE
INITIALIZE ABNDINFO-REC
MOVE EIBRESP TO ABND-RESPCODE
MOVE EIBRESP2 TO ABND-RESP2CODE
Assign APPLID and Task Information
Then, we assign the application ID to ABND-APPLIDEIBTASKNEIBTRNIDABND-TASKNO-KEYABND-TRANID
EXEC CICS ASSIGN APPLID(ABND-APPLID)
END-EXEC
MOVE EIBTASKN TO ABND-TASKNO-KEY
MOVE EIBTRNID TO ABND-TRANID
Perform POPULATE-TIME-DATE
POPULATE-TIME-DATENext, we perform the POPULATE-TIME-DATE
PERFORM POPULATE-TIME-DATE
POPULATE-TIME-DATE
POPULATE-TIME-DATEThe POPULATE-TIME-DATEWS-ORIG-DATEWS-TIME-NOW
POPULATE-TIME-DATE SECTION.
PTD010.
EXEC CICS ASKTIME
ABSTIME(WS-U-TIME)
END-EXEC.
EXEC CICS FORMATTIME
ABSTIME(WS-U-TIME)
DDMMYYYY(WS-ORIG-DATE)
TIME(WS-TIME-NOW)
DATESEP
END-EXEC.
PTD999.
EXIT.
Format Date and Time
Then, we move the original date WS-ORIG-DATEABND-DATEABND-TIME
MOVE WS-ORIG-DATE TO ABND-DATE
STRING WS-TIME-NOW-GRP-HH DELIMITED BY SIZE,
':' DELIMITED BY SIZE,
WS-TIME-NOW-GRP-MM DELIMITED BY SIZE,
':' DELIMITED BY SIZE,
WS-TIME-NOW-GRP-MM DELIMITED BY SIZE
INTO ABND-TIME
END-STRING
Assign Additional Information
We then move the universal time WS-U-TIMEABND-UTIME-KEYABND-CODEABND-PROGRAM
MOVE WS-U-TIME TO ABND-UTIME-KEY
MOVE 'HBNK' TO ABND-CODE
EXEC CICS ASSIGN PROGRAM(ABND-PROGRAM)
END-EXEC
Format Error Message
Next, we move zeros to ABND-SQLCODEABND-FREEFORM
MOVE ZEROS TO ABND-SQLCODE
STRING 'A010 - RETURN TRANSID(OUAC) FAIL.'
DELIMITED BY SIZE,
' EIBRESP=' DELIMITED BY SIZE,
ABND-RESPCODE DELIMITED BY SIZE,
' RESP2=' DELIMITED BY SIZE,
ABND-RESP2CODE DELIMITED BY SIZE
INTO ABND-FREEFORM
Link to Abend Handler
We then link to the abend handler program WS-ABEND-PGMABNDINFO-REC
EXEC CICS LINK PROGRAM(WS-ABEND-PGM)
COMMAREA(ABNDINFO-REC)
END-EXEC
Initialize Failure Information
Finally, we initialize the WS-FAIL-INFOABEND-THIS-TASK
INITIALIZE WS-FAIL-INFO
MOVE 'BNK1UAC - A010 - RETURN TRANSID(OUAC) FAIL' TO
WS-CICS-FAIL-MSG
MOVE WS-CICS-RESP TO WS-CICS-RESP-DISP
MOVE WS-CICS-RESP2 TO WS-CICS-RESP2-DISP
PERFORM ABEND-THIS-TASK
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human