END-EXEC. SERVICE RELOAD BLL-CELLS. EXEC CICS ADDRESS TWA(TWAPTR) END-EXEC. ADD 4096 TWAPTR GIVING TWAPTR2. ADD 4096 TWAPTR2 GIVING TWAPTR3. ADD 4096 TWAPTR3 GIVING TWAPTR4. SERVICE RELOAD TWA. ```** The beginning of the PROCEDURE DIVISION will look slightly different depending on which TP Monitor and Cobol compiler (cont.) you are using. This example is for CICS. Regardless, the logic here is for the sole purpose of getting "addressibility" (cont.) to the TWA and, possibly, other Linkage Section areas. If you alter this logic and thereby cause Storage Violations, (cont.) you will be in grave danger of being lynched by your peers. The CICS abend handler program name is defined on the MMP header definition screen. It is specified by the developer. (cont.) If it is left blank, no abend handler program will be used and normal CICS abends (i.e. ASRA's) will result from data (cont.) exceptions, addressing exceptions, etc. | ``` ** *************************************************************** * * * THE AA---- ROUTINES ARE THE MAINLINES * * THE AAL--- ROUTINES ARE FOR BROWS-FUNCTIONS * * THE AAM--- ROUTINES ARE FOR MAINT-FUNCTIONS * * * **************************************************************** AA100-CHECK-FUNCTION. IF (TWA-MSK-VZN-REQ) GO TO CC100-VERZUN. MOVE SLASH TO D-LIMITER. MOVE PINK TO WINDOW-COLOR. MOVE STK1-LIT TO VS-SR-FORM. MOVE H TO VS-SR-DISPOSITION. MOVE T TO VS-SR-CLASS. MOVE SYS-LIT TO VS-SR-LOCATION. * * * DEFAULT ALGORITHM %PREINIT STARTS HERE * * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * * DEFAULT ALGORITHM %PREINIT ENDS HERE AA150-PROCESS-DETACH-REQUEST. IF (TWA-MSK-DET-REQ) IF (TWA-SCOMPL-ATTDET EQUAL DET-LIT) MOVE VS-ATT-SCOMPL-SV TO SCOMPL MOVE VS-ATT-SERRMSG-SV TO SERRMSG GO TO AA800-SEND-SCREEN. AA155-BYPASS-DETACH-REQUEST. MOVE SFUNCT TO TEST-FUNCT. MOVE SKEY TO TEST-KEY. IF ((TWA-MSK-PF24-HIT) AND (MAINT-FUNCTION)) IF (TWA-MSK-ID = COMMON-POP-MSK) PERFORM FA100-SET-SKEY THRU FA199-EXIT MOVE QUOTE TO TWA-MSK-AID MOVE SPACES TO TWA-MSK-ID ELSE PERFORM FA600-TST-SHORT-LIST-SRC THRU FA699-EXIT IF (NOT SHORT-LIST-AVAIL) MOVE WS-NO-SHORT-LIST-AVAIL TO SCOMPL GO TO AA800-SEND-SCREEN ELSE MOVE TWA-MSK-CUR-AD-IN TO TWA-JERK-CTR PERFORM FA400-CALC-POP-START-POS THRU FA499-EXIT MOVE MSK-CMD TO TWA-TP-REQUEST MOVE COMMON-POP-MSK TO TWA-TP-TRM PERFORM AA800-CALL-MONITOR THRU AA899-EXIT MOVE F TO TWA-MSK-WRT-CMD IF (GET-MSK-ERR) PERFORM BB800-MSK-ERR-MSG THRU BB899-EXIT GO TO AA800-SEND-SCREEN ELSE MOVE VS-ATTR-UNPROTECTED-TABLE TO SERRMSG MOVE TEST-FUNCT TO MSK6PU-SFUNCT MOVE TEST-KEY TO MSK6PU-SKEY MOVE FOUR TO TWA-MSK-CUR-AD-OT MOVE N TO MMP-NEW-TRANSACTION GO TO AAP100-POP-UP-SHORT-LIST. IF TWA-MSK-ID = COMMON-POP-MSK IF (TWA-MSK-ENTER-HIT) PERFORM FA100-SET-SKEY THRU FA199-EXIT MOVE QUOTE TO TWA-MSK-AID MOVE SPACES TO TWA-MSK-ID GO TO AA100-CHECK-FUNCTION ELSE IF (TWA-MSK-PF3-HIT) MOVE TWA-MSK-CUR-AD-OT TO TWA-MSK-CUR-AD-IN MOVE QUOTE TO TWA-MSK-AID MOVE SPACES TO TWA-MSK-ID ELSE MOVE SPACE TO MMP-NEW-TRANSACTION GO TO AAP100-POP-UP-SHORT-LIST. IF SFUNCT NOT = TWA-LAST-FUNCT MOVE F TO TWA-BROWSE-DIRECTION. PERFORM BA100-INIT-STORAGE THRU BA199-EXIT. IF (MAINT-FUNCTION) GO TO AAM200-MAINTENANCE-MAINLINE. IF (BROWS-FUNCTION) GO TO AAL200-BROWSE-MAINLINE. MOVE ZERO TO TWA-MSK-ID. MOVE FTH-FUNCT TO TWA-NONTP-REQUEST. MOVE MSG-LIT TO TWA-TP-OP. MOVE INVALID-FUNCT-MSG TO TWA-MSK-DETAIL. MOVE CLEAR-FUNCT TO SFUNCT. GO TO AA900-GOBACK. ```** The AA100 routine tests for the special AID code which indicates that the program was invoked by the VERZUN function, (cont.) rather than one of its standard application functions (VACSEE, VACLOC, etc.). It then sets the default value into the (cont.) D-LIMITER field. The D-LIMITER is the character used to separate (delimit) key components. For example, using the (cont.) default delimiter of slash ( / ), a compound key could be entered as: 123/45 in the SKEY area of the screen where the first component field's value is 123 and the second component field's value is 45. The Normalize Key routine (cont.) in the MMP would pad the appropriate number of leading zeros to each component in order to build a proper file key. If (cont.) you alter the D-LIMITER to, say, comma ( , ), then that same key would be entered as: 123,45 in the SKEY area of the screen The %PREINIT insertion point allows you to place code near the very beginning of the MMP's logic. One use for it is to (cont.) modify the D-LIMITER. Another use is to schedule the PCB (for IMS or DL/1) and load BLL-CELLS. The PF24 key is used to invoke the pop-up window for the Short-List feature. Next, the AA100 routine tests whether the incoming Function Code in the SFUNCT screen field is: A valid Maintenance Function for this MMP A valid Browse Function for this MMP An invalid Function for this MMP and goes to the appropriate Mainline or issues an error message. Note that to issue this message it "fetches" the (cont.) general-purpose CLEARS Function. You might want to use this technique in your Customization also sometimes. Moving the (cont.) FTH-FUNCT command to TWA-NONTP-REQUEST and moving a Function Code to SFUNCT before going to AA900-GOBACK is how you can (cont.) automatically transfer to any other Function. MAGEC will treat it as if the Operator had actually keyed that Function (cont.) Code into SFUNCT and will do all the same Security checking before transfering control. ## Browse Mainline | ``` ** **************************************************************** * AAL200 BROWSE FUNCTIONS MAINLINE * * IF WRONG MASK, * * GET THIS PROGRAM'S MASK * * IF KEY HAS NOT CHANGED, * * SET UP FOR REDNX FOR 'MORE' DISPLAY * * * **************************************************************** AAL200-BROWSE-MAINLINE. MOVE SFUNCT TO TWA-SHORT-LIST-SOURCE. MOVE SPACES TO TWA-ERR-CODES. * * * DEFAULT ALGORITHM %PFKEYL STARTS HERE IF (TWA-MSK-PF16-HIT) OR (TWA-MSK-PF1-HIT) OR (TWA-MSK-PF17-HIT) MOVE '**ERR1' TO SFUNCT MOVE FTH-FUNCT TO TWA-NONTP-REQUEST GO TO AA900-GOBACK. IF (TWA-MSK-PF11-HIT) MOVE '**HELP' TO SFUNCT MOVE FTH-FUNCT TO TWA-NONTP-REQUEST GO TO AA900-GOBACK. IF (TWA-MSK-PF7-HIT) OR (TWA-MSK-PF8-HIT) PERFORM CA600-SET-BROWSE-DIRECTION THRU CA699-EXIT. IF (TWA-MSK-PF3-HIT) 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. Next: https://magec.com/DOC/markdown/genmmp09.md.txt