07 STAKE08-N PIC S9(9)V9(2) COMP-3.
05 SPARM016.
07 FILLER PIC X(0005).
07 STAKE10E PIC X(0001).
07 FILLER PIC X(0003).
07 STAKE10-N PIC S9(9)V9(2) COMP-3.
05 SPARM017.
07 FILLER PIC X(0005).
07 STAKENE PIC X(0001).
07 FILLER PIC X(0003).
07 STAKEN-N PIC S9(9)V9(2) COMP-3.
05 SPARM018.
07 FILLER PIC X(0005).
07 SYSDATEE PIC X(0001).
07 FILLER PIC X(0003).
07 SYSDATE-DAY-OF-WEEK PIC S9 COMP-3.
07 SYSDATE-JULIAN-DATE PIC S9(9) COMP-3.
05 SPARM019.
07 FILLER PIC X(0005).
07 SYSTIMEE PIC X(0001).
```**
This (preceding) part of the MSK600 Copy Book redefines the TWA-MSK-EDIT-WORDS area of the TWA. Notice that the fields (cont.)
having data names like those of the screen fields but with a suffix of E added are the Error Indicators for the (cont.)
respective screen fields. When the Automatic Editing detects an error in a screen field it sets the Error Indicator for (cont.)
that field to "E". You should do the same in your Customization Editing. MAGEC will automatically Highlight the (cont.)
Attributes for the fields having an E in their Error Indicators and will position the Cursor to the first Error field (cont.)
on the screen.
Notice also the fields named with a -N suffix. These will have the numeric value of the data entered on the screen (if (cont.)
it was a numeric Edit Type field) set by the Automatic Editing. It is what we use to update the database fields with (cont.)
since you could not very well move the display format data to the record. Notice also the special JULIAN-DATE and (cont.)
DAY-OF-WEEK fields generated for all dates. These also are set by Automatic Editing before the MMP is entered. The (cont.)
DAY-OF-WEEK codes are 1 = Sunday, 2 = Monday, etc., 7 = Saturday.
| ```
**
* * * DEFAULT ALGORITHM %USRAREA STARTS HERE
*01 user-work-area PIC X(4096).
* * * DEFAULT ALGORITHM %USRAREA ENDS HERE
```**
The above area is provided with an insertion point (%USRAREA) to allow you to add Linkage section items as needed. The (cont.)
most usual reason to add code here is to insert DBMS areas (i.e. IMS PCB's) which must be Cobol level 01 items in the (cont.)
Linkage section. If you add them here, you must remember to load their corresponding BLL-CELLS (USER-BLL-1 thru (cont.)
USER-BLL-9) in order to have addressibility to them. Failure to do so will result in Storage (cont.)
Violations!
##
Procedure Division
| ```
**
PROCEDURE DIVISION USING DFHEIBLK DFHCOMMAREA.
EXEC CICS HANDLE ABEND PROGRAM('xxxxxxxx')
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)
next: genmmp13.md.txt