IF (TWA-SWAP-ATTACHED)
GO TO AA770-DETACH
ELSE
GO TO AA780-ESCAPE-TO-MENU.
* * * DEFAULT ALGORITHM %PFKEYL ENDS HERE
IF TWA-MSK-ID NOT EQUAL COMMON-LOC-MSK
OR (TWA-LAST-FUNCT NOT EQUAL TEST-FUNCT)
THEN
MOVE ZEERO TO TWA-JERK-CTR
MOVE MSK-CMD TO TWA-TP-REQUEST
MOVE COMMON-LOC-MSK TO TWA-TP-TRM
PERFORM AA800-CALL-MONITOR THRU AA899-EXIT
MOVE E TO TWA-MSK-WRT-CMD
IF (GET-MSK-ERR)
PERFORM BB800-MSK-ERR-MSG THRU BB899-EXIT
GO TO AA800-SEND-SCREEN
ELSE
MOVE TEST-FUNCT TO MSK652-SFUNCT
MOVE TEST-KEY TO MSK652-SKEY
MOVE FOUR TO TWA-MSK-CUR-AD-OT
PERFORM BA100-INIT-STORAGE THRU BA199-EXIT
MOVE MSK652-SFUNCT TO TEST-FUNCT
MOVE MSK652-SKEY TO TEST-KEY
MOVE N TO MMP-NEW-TRANSACTION
MOVE MSK-DOT-LINE TO MSK652-SDOTMSK
MOVE ALL '.' TO MSK652-SSEARCH
GO TO AAL250-SEND-FOR-KEY.
IF TEST-KEY NOT EQUAL TWA-LAST-KEY
MOVE N TO MMP-NEW-TRANSACTION
GO TO AAL250-SEND-FOR-KEY.
IF (TWA-MSK-PF5-HIT) OR (TWA-MSK-PF13-HIT)
MOVE F TO TWA-BROWSE-DIRECTION
MOVE NOT-FOUND-LIT TO TWA-DB-RETURN-CODE.
IF (NOT-FOUND) AND (TWA-MSK-CUR-AD-IN LESS THAN +320)
MOVE N TO MMP-NEW-TRANSACTION
IF TWA-DB-CMD EQUAL SCANS-LIT
GO TO AAL250-SEND-FOR-KEY
ELSE
IF (TWA-MSK-ENTER-HIT)
MOVE SPACE TO MSK652-SKEY, TEST-KEY
GO TO AAL250-SEND-FOR-KEY
ELSE
GO TO AAL250-SEND-FOR-KEY.
MOVE SPACE TO MMP-NEW-TRANSACTION.
* * * * * WS-LINE-SELECTED was calculated in LOCINIT Routine
IF WS-LINE-SELECTED GREATER THAN TWA-NR-LINES-SENT
MOVE BAD-CUR-POS TO MSK652-SCOMPL
MOVE TWA-MSK-CUR-AD-IN TO TWA-MSK-CUR-AD-OT
GO TO AAL750-LEAVE-CUR-SND-SCRN.
IF WS-LINE-SELECTED GREATER THAN ZEERO
MOVE WS-LINE-SELECTED TO TWA-SV-M-SUB
MOVE TWA-SV-M-KEY (WS-LINE-SELECTED) TO TEST-KEY
PERFORM CA500-MOVE-SKEY THRU CA599-EXIT
IF (TWA-MSK-PF4-HIT)
MOVE QUOTE TO TWA-MSK-AID
MOVE WS-CHG-FUNCT TO MSK652-SFUNCT
GO TO AA760-ATTACH
ELSE
MOVE WS-SEE-FUNCT TO MSK652-SFUNCT
GO TO AA760-ATTACH.
```**
The AAL200 routine is the beginning of the Mainline logic for the LOC, SCN, and FND Functions (Browses). It first makes (cont.)
sure that the screen is formatted with the correct Mask (MSK652) for Browses, if needed it will initialize the (cont.)
TWA-MSK-AREA by reading the MSK record. It then sets the MMP-NEW-TRANSACTION indicator depending on whether the (cont.)
Operator has altered the Function or Key on the screen. Refer to Appendix B at the back of this (cont.)
section.
The default logic for the insertion point %PFKEYL supports the standard help key (PF1), the standard copy key (PF16), (cont.)
the standard help index key (PF11), and the standard browse keys (PF8=forward, PF7=backward)
If in Continuation Mode then it checks the Cursor position to see if the Operator has Cursor-Selected an item, if so (cont.)
then it performs the CA500 routine to convert the saved Master Key value for the selected record into the proper screen (cont.)
format with slashes (/) separating the component fields, etc.. It uses the "ATTACH" technique to invoke the designated (cont.)
Function depending on whether the ENTER or PF4 key was hit.
The insertion point provided here named %PFKEYL is you so that you can enter Customization logic to intercept the (cont.)
incoming transaction very early in the processing. One of the primary uses for PFKEYL is to test for the Operator's (cont.)
having used a certain PF key to indicate that he/she wishes to transfer to some other Function. You could also use this (cont.)
point to intercept and modify the Key Value entered before the Normalize Key routine gets to it, perhaps to prefix it (cont.)
with the proper Company number or Department number, etc. so that an Operator can only access records for his/her own (cont.)
Company or Department.
| ```
**
****************************************************************
* AAL250 *
* THIS ROUTINE PERFORMS GENERAL HOUSEKEEPING, INITIALIZING *
* AND BUILDING APPROPRIATE DATA FIELDS. *
****************************************************************
AAL250-SEND-FOR-KEY.
MOVE SPACES TO MSK652-SLIST.
MOVE MASTER-KEY-NAME TO TWA-DB-KEY-NAME.
IF TEST-KEY EQUAL SPACES
ADD ONE TO TWA-J-CTR
IF TWA-J-CTR GREATER THAN TWO
MOVE MSG-LIT TO TWA-TP-OP
MOVE GOIN-NOWHERE-MSG TO TWA-MSK-DETAIL
MOVE CLEAR-FUNCT TO MSK652-SFUNCT
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST
GO TO AA900-GOBACK
ELSE
MOVE EIGHT TO TWA-MSK-CUR-AD-OT
MOVE ENTER-KEY-MSG TO MSK652-SCOMPL
GO TO AAL750-LEAVE-CUR-SND-SCRN.
MOVE ZEERO TO TWA-J-CTR.
```**
The AAL250 routine checks for users who continue tapping the ENTER key after reaching end-of-data or without entering a (cont.)
key value. Without a key value the Operator is "going nowhere", if he/she transmits three times in a row without (cont.)
entering a key value then the MMP issues a message via the FTH-FUNCT command as above.
| ```
**
AAL300-INITIALIZE.
PERFORM BA200-INIT-ATTRIBUTES THRU BA299-EXIT.
MOVE TEST-FUNCT TO TWA-LAST-FUNCT.
IF (FND-FUNCTION)
PERFORM DA300-CALC-SEARCH-LGTH THRU DA399-EXIT
IF ZEERO = SEARCH-LGTHA AND SEARCH-LGTHB
MOVE MSK652-SSEARCH-POSN TO TWA-MSK-CUR-AD-OT
MOVE SCANS-LIT TO TWA-DB-CMD
MOVE NOT-FOUND-LIT TO TWA-DB-RETURN-CODE
MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV
IF SARG-SUB GREATER THAN ZEERO
ADD SARG-SUB TO TWA-MSK-CUR-AD-OT
MOVE CURSOR-POINTING-MSG TO ESM-ERRMSG
MOVE ENTER-SEARCH-MSG TO MSK652-SLIST
GO TO AAL750-LEAVE-CUR-SND-SCRN
ELSE
MOVE LOW-VALUES TO ESM-ERRMSG
MOVE ENTER-SEARCH-MSG TO MSK652-SLIST
GO TO AAL750-LEAVE-CUR-SND-SCRN.
IF (SCN-FUNCTION)
MOVE MSK652-SDOTMSK TO WS-ITEM
PERFORM BA106-BLANK-FIL THRU BA107-EXIT
MOVE WS-ITEM TO MSK652-SDOTMSK
MOVE SPACES TO WS-ITEM
IF (MSK652-SDOTMSK = MSK-DOT-LINE79)
MOVE MSK652-SDOTMSK-POSN TO TWA-MSK-CUR-AD-OT
MOVE SCANS-LIT TO TWA-DB-CMD
MOVE NOT-FOUND-LIT TO TWA-DB-RETURN-CODE
MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV
MOVE ENTER-DOTMSK-MSG TO MSK652-SLIST
GO TO AAL750-LEAVE-CUR-SND-SCRN.
IF (SCN-FUNCTION) OR (FND-FUNCTION)
MOVE MSK652-SDOTMSK TO MSK-DOT-LINE
ELSE
MOVE SPACES TO MSK-DOT-LINE
MSK652-SDOTMSK
TEST-DOT-LINE.
IF (FND-FUNCTION)
PERFORM DA200-FIND-PARENS THRU DA299-EXIT
IF (ERROR-FOUND)
MOVE SPACE TO FATAL-ERR
MOVE MSK652-SDOTMSK-POSN TO TWA-MSK-CUR-AD-OT
ADD DOT-SUB TO TWA-MSK-CUR-AD-OT
MOVE SCANS-LIT TO TWA-DB-CMD
MOVE NOT-FOUND-LIT TO TWA-DB-RETURN-CODE
MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV
MOVE CURSOR-POINTING-MSG TO ESM-ERRMSG
MOVE ENTER-SEARCH-MSG TO MSK652-SLIST
GO TO AAL750-LEAVE-CUR-SND-SCRN
ELSE
IF (SEARCH-LGTHA GREATER THAN
(SEARCH-STOP + ONE - SEARCH-START))
THEN
MOVE MSK652-SDOTMSK-POSN TO TWA-MSK-CUR-AD-OT
MOVE SCANS-LIT TO TWA-DB-CMD
MOVE NOT-FOUND-LIT TO TWA-DB-RETURN-CODE
MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV
MOVE SHORT-SCAN-AREA-MSG TO MSK652-SLIST
GO TO AAL750-LEAVE-CUR-SND-SCRN.
IF (TWA-MSK-PF5-HIT)
MOVE F TO TWA-BROWSE-DIRECTION
MOVE N TO MMP-NEW-TRANSACTION.
IF (NEW-TRANSACTION-MODE)
IF TEST-KEY EQUAL SPACES
MOVE EIGHT TO TWA-MSK-CUR-AD-OT
MOVE E TO MSK652-SKEYE
MOVE ENTER-KEY-MSG TO MSK652-SCOMPL
GO TO AAL750-LEAVE-CUR-SND-SCRN
ELSE
PERFORM BA300-NORMALIZE-KEY THRU BA399-EXIT
IF SKEYE EQUAL E
MOVE EIGHT TO TWA-MSK-CUR-AD-OT
MOVE INVALID-KEY-MSG TO MSK652-SCOMPL
GO TO AAL750-LEAVE-CUR-SND-SCRN.
MOVE TEST-FUNCT TO TWA-LAST-FUNCT.
MOVE NEXT-PAG-MSG TO MSK652-SCOMPL.
IF (BROWSE-BACKWARD)
MOVE BROWSING-BACKWARDS TO TWA-SERRMSG-MSG (5)
ELSE
MOVE BROWSING-FORWARDS TO TWA-SERRMSG-MSG (5).
```**
The AAL300 routine initializes the screen attributes and parses the SCN Function's Selection Mask line or the FND (cont.)
Function's Search Arguments. It forces the MMP into New Transaction Mode if the Operator hit PF5, this will return the (cont.)
screen's display to the first "page" instead of "paging forward". If in New Transaction Mode it performs the Normalize (cont.)
Key routine to edit and format the entered Key Value in preparation for reading the file. It tests the (cont.)
TWA-BROWSE-DIRECTION indicator to see whether the REDNX command will read forward or backwards and moves an appropriate (cont.)
message into the last line of the screen.
| ```
**
****************************************************************
* AAL400 *
* THIS ROUTINE POSITIONS TO THE FIRST DATABASE RECORD *
* HAVING A KEY VALUE EQUAL TO OR GREATER THAN THAT *
next: genmmp14.md.txt