Managing Account (BNK1DAC)
The BNK1DAC
The BNK1DAC
PF5
Here is a high level diagram of the program:
Key Evaluation and Action Perform
Handling First Time Through
First, the code checks if it is the first time through by evaluating if EIBCALEN
BNK1DAO
ACCNOL
SEND-ERASE
WS-COMM-AREA
SEND-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 BNK1DAO
MOVE -1 TO ACCNOL
SET SEND-ERASE TO TRUE
INITIALIZE WS-COMM-AREA
PERFORM SEND-MAP
Handling PA Key Press
Next, if a PA key (DFHPA1
DFHPA2
DFHPA3
* If a PA key is pressed, just carry on
*
WHEN EIBAID = DFHPA1 OR DFHPA2 OR DFHPA3
CONTINUE
Handling PF3 Key Press
When the PF3 key is pressed, the code executes a CICS RETURN command to return to the main menu by setting the transaction ID to 'OMEN' and handling the response codes.
* 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 PF5
Key Press
PF5
When the PF5
PROCESS-MAP
* When Pf5 is pressed, process the map
*
WHEN EIBAID = DFHPF5
PERFORM PROCESS-MAP
Handling PF12 Key Press
When the PF12 key is pressed, the code performs the SEND-TERMINATION-MSG
* When Pf12 is pressed, send a termination
* message.
*
WHEN EIBAID = DFHPF12
PERFORM SEND-TERMINATION-MSG
EXEC CICS
RETURN
END-EXEC
Handling CLEAR Key Press
When the CLEAR key is pressed, the code sends a control command to erase the screen and free the keyboard, followed by a CICS RETURN command.
* When CLEAR is pressed
*
WHEN EIBAID = DFHCLEAR
EXEC CICS SEND CONTROL
ERASE
FREEKB
END-EXEC
EXEC CICS RETURN
END-EXEC
Handling ENTER Key Press
When the ENTER key is pressed, the code performs the PROCESS-MAP
* When enter is pressed then process the content
*
WHEN EIBAID = DFHENTER
PERFORM PROCESS-MAP
Handling Invalid Key Press
When any other key is pressed, the code moves low values to BNK1DAO
MESSAGEO
ACCNOL
SEND-DATAONLY-ALARM
SEND-MAP
* When anything else happens, send the invalid key message
*
WHEN OTHER
MOVE LOW-VALUES TO BNK1DAO
MOVE 'Invalid key pressed.' TO MESSAGEO
MOVE -1 TO ACCNOL
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM SEND-MAP
COMMAREA Data Preparation
This is the next section of the flow.
Checking Account Type
First, we check if INQACC-EYE
IF INQACC-EYE = 'ACCT'
Transferring Account Information
Moving to the next step, if the account type is 'ACCT', we transfer various fields from INQACC
WS-COMM
MOVE INQACC-EYE TO WS-COMM-EYE
MOVE INQACC-CUSTNO TO WS-COMM-CUSTNO
MOVE INQACC-SCODE TO WS-COMM-SCODE
MOVE INQACC-ACCNO TO WS-COMM-ACCNO
MOVE INQACC-ACC-TYPE TO WS-COMM-ACC-TYPE
MOVE INQACC-INT-RATE TO WS-COMM-INT-RATE
MOVE INQACC-OPENED TO WS-COMM-OPENED
MOVE INQACC-OVERDRAFT TO WS-COMM-OVERDRAFT
MOVE INQACC-LAST-STMT-DT TO WS-COMM-LAST-STMT-DT
MOVE INQACC-NEXT-STMT-DT TO WS-COMM-NEXT-STMT-DT
MOVE INQACC-AVAIL-BAL TO WS-COMM-AVAIL-BAL
MOVE INQACC-ACTUAL-BAL TO WS-COMM-ACTUAL-BAL
MOVE INQACC-SUCCESS TO WS-COMM-SUCCESS
Initializing Communication Area
Then, if the account type is not 'ACCT', we initialize WS-COMM-AREA
ELSE
INITIALIZE WS-COMM-AREA
END-IF
Interim Summary
So far, we saw how different key presses are handled in the CICS Bank Sample Application, including actions for PA, PF3, PF5
CICS Return Setup
Handling the Response of a Transaction Initiation
First, the transaction is initiated with the RETURN TRANSID('ODAC')
COMMAREA
WS-COMM-AREA
LENGTH
RESP
RESP2
RETURN TRANSID('ODAC')
COMMAREA(WS-COMM-AREA)
LENGTH(102)
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC.
Checking the Transaction Response
Next, the response of the transaction initiation is checked. If WS-CICS-RESP
DFHRESP(NORMAL)
POPULATE-TIME-DATE
RETURN TRANSID('ODAC')
COMMAREA(WS-COMM-AREA)
LENGTH(102)
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC.
Populating the Current Time and Date
The POPULATE-TIME-DATE
EXEC CICS ASKTIME
WS-U-TIME
EXEC CICS FORMATTIME
WS-ORIG-DATE
WS-TIME-NOW
POPULATE-TIME-DATE SECTION.
PTD010.
D DISPLAY 'POPULATE-TIME-DATE SECTION'.
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.
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human