05 TWA-SV-M-KEY OCCURS 16 TIMES. 07 TWA-SV-KEY PIC X(38). 03 TWA-NR-LINES-SENT PIC S9(4) COMP SYNC. 03 TWA-JERK-CTR PIC S9(4) COMP SYNC. 03 TWA-J-CTR REDEFINES TWA-JERK-CTR PIC S9(4) COMP SYNC. 03 CUMULATIVE-SCAN-CTR PIC S9(9) COMP SYNC. 03 CUMULATIVE-DSPLY-CTR PIC S9(9) COMP SYNC. 03 PAGE-CTR PIC S9(9) COMP SYNC. 03 SAVE-AUDIT-STAMP PIC X(36). 03 STD-CUR-AD-OT PIC S9(4) COMP SYNC. 03 WINDOW-WIDTH PIC S9(4) COMP SYNC. 03 TWA-FIRST-POP-LINE PIC S9(4) COMP SYNC. 03 WS-ROW PIC S9(4) COMP SYNC. 03 WS-COLUMN PIC S9(4) COMP SYNC. 03 TOP-LEFT-POSN PIC S9(4) COMP SYNC. 03 WINDOW-COLOR PIC X. 03 D-LIMITER PIC X. 03 VS-SR-FORM PIC X(4). 03 VS-SR-DISPOSITION PIC X. 03 VS-SR-CLASS PIC X. 03 VS-SR-LOCATION PIC X(3). ```** VS-MARKER is set to the time (HHMMSS) before any I/O is done and then is compared after the I/O is complete to see if (cont.) it has been wiped out by reading data that is too large for the area it was read into. This can happen when you have an (cont.) incorrect copybook for an Element. TWA-SAVE-MST-KEYS-AREA is used by Browse Functions. They save the Master (Primary) key values for the records listed on (cont.) the screen . If the Operator Cursor Selects one to SEE or CHG it the MMP finds the key value in this saved (cont.) area. TWA-NR-LINES-SENT is set by the Browses to indicate how many lines of data were sent to the screen. TWA-JERK-CTR is (cont.) used to count the number of times the Operator continues to tap the ENTER key after reaching end-of-data, at the count (cont.) of three he/she will get a "nastygram". CUMULATIVE-SCAN-CTR, CUMULTIVE-DSPLY-CTR, and PAGE-CTR are used by the Browses to build the "page number" line at the (cont.) bottom of the Browse displays and to check whether the SCAN-LIMIT has been reached. SAVE-AUDIT-STAMP is used to save the Audit Stamp when a record is read so that the MMP can compare it to the Audit (cont.) Stamp when the record is read-for-update to see if it has been updated by another task. STD-CUR-AD-OT is the "default" Cursor position to be used if the MMP does not otherwise set it. It is set when the Mask is initialized to position to the first enterable field on the screen. There are several work fields here which are used by the pop-up window facility. You can control the width, color, and position of the pop-up window by setting values into them. The D-LIMITER is the character used to separate component fields within a key value when it is entered into the SKEY (cont.) screen field. It defaults to a slash (/) but can be set to another value in %PREINIT. | ``` ** **************************************************************** * * * THE FOLLOWING AREA WILL BE INITIALIZED UPON * * ENTRY EVERY TIME. IT CONTAINS ALL THE VARIABLE * * FIELDS FOR THE MMP * * * **************************************************************** 03 VARIABLE-STORAGE. 04 FILLER. 05 KEY-NAME. 07 FILLER PIC X(4). 07 KN-NO PIC X. 05 KEY-PARM-X. 07 FILLER OCCURS 5 TIMES. 09 KP-MAX-LGTH PIC S99. 09 KP-MIN-LGTH PIC S99. 09 KP-TYPE PIC X. 05 NUMBER-OF-RECORDS PIC S9(4) COMP SYNC. 05 PROCESS-INDICATOR PIC X. 88 END-OF-LIST-INDICATED VALUE 'E'. 88 BYPASS-INDICATED VALUE 'B'. 88 PROCESS-INDICATED VALUE 'P'. 05 TEST-FUNCT PIC X(6). * * * DEFAULT ALGORITHM %FUNCT STARTS HERE 88 MAINT-FUNCTION VALUE 'VACADD' 'VACCHG' 'VACDEL' 'VACSEE' 'VACNXT' 'VACDUP'. 88 BROWS-FUNCTION VALUE 'VACLOC' 'VACSCN' 'VACFND'. 05 FILLER REDEFINES TEST-FUNCT. 07 TEST-FUNCT-KEY PIC XXX. 07 T-FUNCT PIC XXX. 88 SEE-FUNCTION VALUE 'SEE' 'NXT'. 88 NXT-FUNCTION VALUE 'NXT'. 88 ADD-FUNCTION VALUE 'ADD'. 88 CHG-FUNCTION VALUE 'CHG'. 88 DEL-FUNCTION VALUE 'DEL'. 88 DUP-FUNCTION VALUE 'DUP'. 88 LOC-FUNCTION VALUE 'LOC'. 88 SCN-FUNCTION VALUE 'SCN'. 88 FND-FUNCTION VALUE 'FND'. * * * DEFAULT ALGORITHM %FUNCT ENDS HERE ```** The VARIABLE-STORAGE area is where all program "variables" should be placed. This area is used instead of the (cont.) WORKING-STORAGE for work fields which are not to be passed from transaction to transaction. It is initialized at the (cont.) start of the MMP processing by moving LOW-VALUES to it, any fields within it which are to be initialized to some other (cont.) value must be initialized in the BA100-INIT-STORAGE routine - an insertion point is provided for such (cont.) initializations. From VARIABLE-STORAGE on down, MAGEC does not save and restore the TWA. When the MMP is entered this area has random (cont.) contents, often described better as "garbage", that is why the BA100 routine moves the LOW-VALUES to it immediately, (cont.) then initializes other fields within it. KEY-NAME is the area where the Browse Functions build the 5-char. standard key name to use in the MAGECIO Request. (cont.) KEY-PARM-X is a work area used by the Normalize Key routines in editing the Operators key value (cont.) entry. NUMBER-OF-RECORDS is set in the BA100 routine to a default of 16 to control the number of lines of data which can be displayed for browses, you can set it differently if you wish. PROCESS-INDICATOR is checked in the CA700 routine to determine if a given record is to be listed in the Browse screens (cont.) or not. It is used in the standard logic generated for SCN and FND Functions and there is an insertion point provided (cont.) for you to code selection logic and set this indicator if you wish. You can process, bypass, or force end of list on (cont.) any given record. TEST-FUNCT is where the MMP saves the Function Code from the screen and where it checks to see what type of Function is (cont.) to be done. It is referenced throughout the MMP, if you alter it you had better review the complete logic of the MMP to (cont.) understand the implications. The insertion point %FUNCT is provided to permit you to override defaults generated for defining the valid Functions (cont.) for this MMP. In this example you see that the default values are taken. You could code a Custom Algorithm to be used (cont.) instead. | ``` ** 05 TEST-KEY. 07 TK-BYTE OCCURS 38 TIMES PIC X. 05 FILLER REDEFINES TEST-KEY. 07 FILLER PIC XX. 07 TK-DATA PIC X(34). 05 TEST-KEY-LOWER-CASE PIC X. 88 TK-LOW-CASE VALUE 'a' THRU 'i' 'j' THRU 'r' 's' THRU 'z'. 05 KEY-WORK. 07 KW-BYTE OCCURS 31 TIMES PIC X. 05 WS-MAX-LGTH PIC S9(4) COMP SYNC. 05 NORMALIZED-KEY. 07 NK-BYTE OCCURS 101 TIMES PIC X. 05 FILLER REDEFINES NORMALIZED-KEY. 07 FILLER PIC X. 07 NK-2-END PIC X(100). 05 NORM-KEY. 07 NK-KEY1. 09 NK-KEY1-N PIC 9(09). 07 NK-KEY2. 09 NK-KEY2-N PIC X(09). 07 NK-KEY3. 09 NK-KEY3-N PIC X(01). 07 NK-KEY4. 09 NK-KEY4-N PIC X(01). 07 NK-KEY5. 09 NK-KEY5-N PIC X(01). 05 FILE-KEY. 07 FILE-KEY1 PIC 9(09). 07 FILE-KEY2 PIC X(09). 07 FILE-KEY3 PIC X(01). 07 FILE-KEY4 PIC X(01). 07 FILE-KEY5 PIC X(01). ```** The above areas are all used in the Editing and Normalization of the key value. The "raw" input key value is placed (cont.) into TEST-KEY and the Normalize Key routine places the formatted and edited results into NORMALIZED-KEY where the MMP (cont.) gets it to move to TWA-KEY-VALUE to read the file. The FILE-KEY area is generated with proper Cobol PICtures to define the component key fields. You might sometimes want (cont.) to reference these component fields in your Customization logic. Do not alter the area named NORMALIZED-KEY because it (cont.) is used later in the MMP logic to move to the key portion of the record on updates. | ``` ** 05 WS-ITEM-KEY PIC X(64). 05 WS-LINE-SELECTED PIC S9(4) COMP SYNC. 05 SCAN-CTR PIC S9(9) COMP SYNC. 05 SEARCH-LGTHA PIC S9(4) COMP SYNC. 05 SEARCH-LGTHB PIC S9(4) COMP SYNC. 05 SEARCH-START PIC S9(4) COMP SYNC. 05 SEARCH-STOP PIC S9(4) COMP SYNC. 05 SARG-SUB PIC S9(4) COMP SYNC. 05 SARGA-SUB PIC S9(4) COMP SYNC. 05 SARGB-SUB PIC S9(4) COMP SYNC. 05 SCW-SUB PIC S9(4) COMP SYNC. 05 SLW-SUB PIC S9(4) COMP SYNC. 05 SC-SUB PIC S9(4) COMP SYNC. 05 LIN-CTR PIC S9(4) COMP SYNC. 05 LIN-LO-SUB PIC S9(4) COMP SYNC. 05 LIN-HI-SUB PIC S9(4) COMP SYNC. 05 F-SUB PIC S9(4) COMP SYNC. 05 D-SUB PIC S9(4) COMP SYNC. 05 ATTR-SUB PIC S9(4) COMP SYNC. 05 TK-SUB PIC S9(4) COMP SYNC. 05 NK-SUB PIC S9(4) COMP SYNC. 05 NN-SUB PIC S9(4) COMP SYNC. 05 KW-SUB PIC S9(4) COMP SYNC. 05 FL-SUB PIC S9(4) COMP SYNC. 05 KEY-SUB PIC S9(4) COMP SYNC. 05 SEQ-SUB PIC S9(4) COMP SYNC. 05 NR-CHARACTERS PIC S9(4) COMP SYNC. 05 ERR-SUB PIC S9(4) COMP SYNC. 05 DOT-SUB PIC S9(4) COMP SYNC. 05 HOLD-DOT-SUB PIC S9(4) COMP SYNC. 05 PM-SUB PIC S9(4) COMP SYNC. 05 INSP-SUB PIC S9(4) COMP SYNC. 05 SF-SUB PIC S9(4) COMP SYNC. 05 DE-SUB PIC S9(4) COMP SYNC. 05 DV-SUB PIC S9(4) COMP SYNC. 05 TWA-START-ADDR PIC S9(9) COMP SYNC. 05 TWA-END-ADDR PIC S9(9) COMP SYNC. 05 ERROR-NUMBER PIC X(3). 05 MMP-NEW-TRANSACTION PIC X. 88 NEW-TRANSACTION-MODE VALUE 'N'. 88 CONTINUATION-MODE VALUE ' '. 05 UPPERCASE-SW PIC X. 05 WS-SERRMSG. 07 WS-SEQ-MSG PIC X(40). 07 FILLER PIC X(200). 05 PAT-BYTE PIC X. 05 PATTERN-MASK. 07 PM-BYTE OCCURS 50 TIMES PIC X. 05 SCREEN-FIELD. Next: https://magec.com/DOC/markdown/genmmp04.md.txt