MODELMMP MODLOCAT
Location:
WORKING-STORAGE
Description:
This insertion point is obsolete. Use %LITERAL.
###
Online Insertion Point
%LOCMOV
Found in Model:
MODELMMP MODLOCAT MODELWIN
Location:
PROCEDURE DIVISION -- CA700-MOVE-TO-WORK-AREA
Description:
This logic is executed immediately following the standard MOVE's from the MMP's Logical Record to the WS-ITEM area. It is only executed for Browse functions.
The Logical Record is made up of the Elements read from the Primary Data Class plus any Elements read from "Logically (cont.)
Joined" Data Classes plus any "derived fields" you may have calculated in the %JOIN routine. WS-ITEM is the "print (cont.)
line" which is moved to the screen, one line per item.
The xxxSCN and xxxFND functions do their comparisons to determine whether or not to display this item after the %LOCMOV logic is done.
Suggested Uses:
You can modify the "print line" before it is displayed.
You can make your own determination as to whether or not you want this item displayed, to bypass this item you can code:
MOVE B TO PROCESS-INDICATOR.
You might want to have several functions which are variations of the xxxLOC function, each of which displays different (cont.)
data from the Logical Record. In %LOCMOV you could build the alternate print lines and overlay WS-ITEM by moving the (cont.)
appropriate one to it based on the value of TEST-FUNCT.
Cautions:
Do not try to reference screen fields, except in MSK652.
Be careful not to corrupt LIN-CTR, which is used as a subscript into the screen lines, or as a line-per-page counter if PF13 was hit (hardcopy report key).
Do not MOVE to the screen using LIN-CTR if PF13 was hit.
The changes you make to WS-ITEM will affect the comparisons made by the SCN or FND tests.
###
Online Insertion Point
%LOCVARS
Found in Model:
MODELMMP MODLOCAT  MODELWIN
Location:
VARIABLE-STORAGE
Description:
This insertion point is obsolete. Use %VARSTOR.
###
Online Insertion Point
%NKLOC
Found in Model:
MODELMMP MODLOCAT MODELWIN
Location:
PROCEDURE DIVISION -- BA300-NORMALIZE-KEY
Description:
The default logic for this insertion point is the entire BA300-NORMALIZE-KEY THRU BA399-EXIT routine. It is executed (cont.)
for Browse functions (xxxLOC, xxxSCN, xxxFND) to convert the operator's entry into SKEY into the format used as a key (cont.)
to read the Primary Data Class.
Suggested Uses:
It is very unlikely that you will ever need to use this insertion point. If you do you must replace the entire routine, including the BA300-NORMALIZE-KEY and BA399-EXIT paragraph names.
If you have a size problem with your MMP (it's too big), and you have a simple key format, then you might want to save (cont.)
space by writing a simpler, smaller, less versatile routine to replace the standard one.
Cautions:
Do not forget those paragraph names.
The standard routine is very powerful and flexible. It handles multi-key files with compound keys with mixed data (cont.)
representations (COMP, COMP-3, ALPHANUMERIC, etc.). If you replace it, you are on your own!
Take a good look at the standard routine first. It is generated based on your KYF definitions for the Primary Data Class.
See if you can intercept the key value (in TEST-KEY) in the %PFKEYL insertion point and "massage" it there rather than using %NKLOC, if at all possible.
###
Online Insertion Point
%NORMKEY
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- BA400-NORMALIZE-MAINT-KEY
Description:
This logic is within the Maintenance functions' Normalize Key routine. It is positioned after the standard logic has (cont.)
done all of its editing and reformatting of the key value (from the screen field: SKEY). If any errors were found then (cont.)
the %NORMKEY logic will not be executed since the routines above exit with an error message when they detect an (cont.)
error.
The complete formatted key value, presumably ready for use to read the Primary Data Class, will be in FILE-KEY, ready (cont.)
to be MOVE'd to NORMALIZED-KEY, where the I/O routines will be looking for it later. The MOVE FILE-KEY TO (cont.)
NORMALIZED-KEY is coded immediately following the %NORMKEY insertion point.
Suggested Uses:
You may code some additional edits of the key data. If you detect an error you can GO TO BA480-BAD-KEY to properly set (cont.)
the error indicators. You may MOVE an error message to the screen field: SERRMSG, if you like.
You may "massage" the key value here. You may add a prefix or suffix based on the Terminal ID, Operator ID, Location, (cont.)
or any other criteria. This might be valuable to help you assure that operators only access their own (cont.)
data.
Make your alterations in the FILE-KEY area, it will be MOVE'd to NORMALIZED-KEY when you fall-through to the following code unless you have exited with an error (to BA480-BAD-KEY).
Cautions:
Either GO TO BA480-BAD-KEY or fall through to the following MOVE to NORMALIZED-KEY. Do not GO TO BA499-EXIT without the NORMALIZED-KEY area being properly set.
If you do I/O here you should save TWA-DB-REQUEST in TWA-DB-REQ-SAV and restore it when you are done.
This logic applies only to the MAINT-FUNCTION's. Do not confuse this insertion point with the %NKLOC insertion point which is for BROWS-FUNCTION's.
###
Online Insertion Point
%PFKEYL
Found in Model:
MODELMMP MODLOCAT MODELWIN
Location:
PROCEDURE DIVISION -- AAL200-BROWSE-MAINLINE
Description:
This logic is executed for every Browse function, in NEW-TRANSACTION-MODE and in CONTINUATION-MODE. It is at the very (cont.)
top of the mainline logic and is the earliest point at which you can intercept the transaction, except that you can (cont.)
intercept it earlier in the %PREINIT insertion point which is before the logic has even determined whether this is a (cont.)
MAINT-FUNCTION or a BROWS-FUNCTION.
This logic is executed prior to the verification that the COMMON-LOC-MSK is formatted.
There is default logic for this insertion point. It tests for the standard SAA compliant PF keys (PF7=browse backward, PF8=browse forward, PF11=help index, PF16=copy data to buffer, PF1=help).
Suggested Uses:
You can intercept the Browse logic at the very beginning and "massage" the SKEY or SFUNCT values, if you like.
You can, conditionally or unconditionally, bypass the entire remainder of the standard logic by "doing your own thing" and then GO'ing to AA800-SEND-SCREEN or AA900-GOBACK.
You may also have some custom logic in the %SNDSCRN insertion point, at the very end of the processing logic.
You can, in %PFKEYL test for which transmit key (ENTER or PF key) was hit, and take any actions accordingly. The (cont.)
88-level tests for which key was hit (TWA-MSK-PFn-HIT, etc.) will work correctly even if the COMMON-LOC-MSK has not yet (cont.)
been formatted.
You MAY simulate any valid key having been hit by MOVE'ing the appropriate value to TWA-MSK-AID, to "fool" the MMP.
Cautions:
You should not refer to screen fields, except for the four standard MAGEC fields which are present on any Mask (SKEY, SFUNCT, SCOMPL, SERRMSG).
Remember that the MMP might initialize (format) the TWA-MSK-AREA (overlaying anything you have MOVE'd there) immediately following the %PFKEYL logic.
If you wish to alter the contents of SKEY and/or SFUNCT then you should MOVE the new value(s) to TEST-KEY and TEST-FUNCT as well.
Do not use TEST-KEY or TEST-FUNCT as work areas, they contain the current function and key value from the screen.
Remember, PF13, PF15, PA1, CLEAR, and PA2 have predefined meanings in MAGEC!
###
Online Insertion Point
%PFKEYM
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- AAM200-MAINTENANCE-MAINLINE
Description:
This logic is executed at the very beginning of the mainline for all MAINT-FUNCTION's (xxxADD, xxxCHG, xxxSEE, etc.). (cont.)
It is done for every transaction, whether in NEW-TRANSACTION-MODE or in CONTINUATION-MODE.
The default coding tests for the PF7 or PF8 keys being hit and sets TWA-BROWSE-DIRECTION to B (backwards browse if PF7) (cont.)
or F (forward browse if PF8) and transfers to the xxxNXT function, or for PF4 on any other MAINT-FUNCTION to transfer (cont.)
to the xxxLOC function. It tests for PF1 and PF2, the high-level and low-level help keys, and for PF11, the help index (cont.)
key, and for PF16 and PF17, the copy and paste keys. It also checks for a movement of the cursor to denote that the (cont.)
operator may have intended to do a xxxCHG but forgot to alter the function code (in SFUNCT).
Suggested Uses:
You can test for any PF key here before the standard mainline logic. You can alter the key value (in SKEY and TEST-KEY) (cont.)
and/or the function code (in SFUNCT and TEST-FUNCT). You can also bypass the entire standard mainline by coding your (cont.)
own logic and then GO'ing to AA800-SEND-SCREEN or to AA900-GOBACK. You may want to "fool" the standard logic of the MMP (cont.)
by altering the value in TWA-MSK-AID to indicate which key was hit (ENTER or a PF key).
If you wish to automatically generate the key value on an ADD function, then you might want to intercept the operator's (cont.)
key entry (in SKEY and TEST-KEY) here so as to allow it to pass the Normalize-Key editing even though the actual key (cont.)
value will not be determined until just prior to adding the record in the %ADDIT insertion point. This will allow the (cont.)
operator to omit the key value when entering the xxxADD command without receiving the INVALID-KEY (cont.)
message.
Some installations prefer to have the operator enter a key value of "NEW" or some other such phrase rather than just leaving the SKEY field blank.
Cautions:
Remember, PA1, PA2, CLEAR, PF15, and PF13 have predefined meanings in MAGEC. SKEY has already been MOVE'd to TEST-KEY so you must make any changes to both fields!
Since the screen may not yet have been formatted with THIS-PGMS-MSK you should avoid referencing screen fields except for the standard MAGEC fields, SFUNCT, SKEY, SCOMPL, and SERRMSG.
If you want to alter SFUNCT and/or SKEY you should also MOVE them to TEST-FUNCT and TEST-KEY.
If the access method for your Primary file is one which does not support backwards browses, you should override the (cont.)
MOVE B TO TWA-BROWSE-DIRECTION and also overlay the NXT-OR-PREV-MSG by MOVE'ing your own message to (cont.)
it.
###
Online Insertion Point
%PREINIT
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- AA100-CHECK-FUNCTION
Description:
This logic is executed at the very beginning of the mainline for all BROWS-FUNCTION's and MAINT-FUNCTION's. It is done for every transaction, whether in NEW-TRANSACTION-MODE or in CONTINUATION-MODE.
There is no default code. If you do not provide any customization coding then only a comment line will be inserted into the program.
Suggested Uses:
You can intercept the logic of the program at the very beginning. This is a handy place for accomplishing some (cont.)
necessary database "binding", i.e. for DL/1 scheduling the PCB, or for SQL issuing the CONNECT.
You can alter the delimiter character used for the free-form data in SKEY. For example:
 
MOVE COMMA TO D-LIMITER.
D-LIMITER has a default value of slash (/), which is normally the key field separator for MAGEC screens. Moving a (cont.)
different character to D-LIMITER changes the key delimiter so that the Normalize-Key routines now expect a key of, say: (cont.)
123,xyz instead of 123/xyz.
You can alter the color of the pop-up window which appears for the Short-List feature. To do so, you set the desired color value into the WINDOW-COLOR variable. For example:
 
  MOVE TURQUOISE TO WINDOW-COLOR.
The color codes are discussed in the "Color 3270" chapter of this *Programmer's Reference* manual. The default color for the pop-up window is PINK.
Cautions:
This insertion point is prior to the initialization of the VARIABLE-STORAGE area and prior to the setting of the (cont.)
function and key values into TEST-KEY and TEST-FUNCT. You must not code references to the 88-levels which define the (cont.)
valid conditions for those areas, i.e. ADD-FUNCTION, BROWS-FUNCTION, et cetera. unless you first MOVE SFUNCT TO (cont.)
TEST-FUNCT.
It is possible that the Mask for this program has not yet been initialized at this point in the logic. Do not reference screen fields without first interrogating which Mask is initialized, i.e:
  IF TWA-MSK-ID = THIS-PGMS-MSK (or COMMON-LOC-MSK) . . .
###
Online Insertion Point
%RDUKY
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- AAM420-READ-BY-KEY-FOR-UPDATE
Description:
This logic is executed in the CONTINUATION-MODE of the xxxDEL and xxxCHG functions. It reads the Primary Data Class' (cont.)
record (Elements) with Exclusive Control in preparation for the update or delete operation. The standard default logic (cont.)
calls the MAGEC I/O module to do the read and then PERFORM's the JA100-LOGICAL-JOIN routine to read any Secondary (cont.)
data.
The default code also compares the Audit-Stamp for the record (if it has one) against the Audit-Stamp it saved when the (cont.)
record was read (in %REDKY) in the NEW-TRANSACTION-MODE to see if another task has updated it while the operator was (cont.)
mulling over the screen.
Suggested Uses:
You could override the entire default routine with your own to access a non-MAGEC file or database.
When you begin to enter customization coding for %RDUKY you will be presented a Proforma routine which very much (cont.)
resembles the default code. This is to allow you to make alterations or additions to the default logic without having (cont.)
to rekey the entire routine.
Cautions:
To exit this routine GO TO AAM440-TEST-RETURN-CODE or just fall through to the GO TO which is coded immediately following the %RDUKY insertion point.
If you substitute the call to the MAGEC I/O module with your own read of a non-MAGEC file or database, you should set (cont.)

next: insert05.md.txt