To exit you should GO TO AA900-GOBACK, or allow the logic to fall through to the GO TO which is coded just below the %SNDSCRN insertion point.
If you reference any screen fields other than the four MAGEC standard fields (SFUNCT, SKEY, SCOMPL, and SERRMSG) then (cont.)
you must first test whether your Maintenance Mask or the Common Browse Mask (MSK652) is formatted. This logic is (cont.)
executed for both MAINT-FUNCTION's and BROWS-FUNCTION's!
If you alter the contents of SKEY you will probably also want to set the new contents into TWA-LAST-KEY so that the MMP (cont.)
and MAGECCP will know what the key value was when it compares against it on the next transaction. That is how they know (cont.)
whether the operator has changed it.
###
Online Insertion Point
%SPOOL
Found in Model:
MODELMMP
Location:
PROCEDURE DIVISION -- CB900-SPOOL
Description:
This insertion point is used to contain the logic to spool print data from your MMP.
Suggested Uses:
The default coding for this insertion point is contained in a -MAGECINC'd member named SPOOLIT. It is the standard (cont.)
logic for spooling a report from the MAINT or BROWSE screens. You can override the default logic by coding your own (cont.)
custom logic, perhaps to spool to a spooler other than MAGEC's intrinsic TP Spooler.
Cautions:
Be sure you understand the protocols for using the MAGEC spooler or any other spooler software you are trying to use. Misuse can cause serious abend difficulties.
###
Online Insertion Point
%SUBRTNL
Found in Model:
MODELMMP MODLOCAT  MODELWIN
Location:
PROCEDURE DIVISION -- before JA999-STOP-RUNAWAY
Description:
This insertion point is positioned near the very end of the program to allow you to insert entire routines to be PERFORM'd from elsewhere.
Suggested Uses:
Entire routines, including all paragraph names and exits can be inserted here and PERFORM'd from anywhere else.
This is handy when converting to MAGEC from "native" programs which contain sections of coding which you wish to (cont.)
retain. One example might be a complex cross-field edit routine, another might be a large calculation (cont.)
routine.
You can insert virtually the entire PROCEDURE DIVISION for a program here, then in the %PFKEYM (or %PFKEYL) insertion (cont.)
point you could PERFORM it and GO TO AA900-GOBACK. This would effectively override the entire logic of the MMP with (cont.)
your own. You would most likely do something like that for a special function code which you might have added to the (cont.)
MMP in the %FUNCT insertion point in addition to the standard nine functions MAGEC generates.
%SUBRTNM and %SUBRTNL are functionally equivalent in MODELMMP
Cautions:
If your coding contains an error which causes it to bypass the EXIT (or implied EXIT) of a routine, then you might very (cont.)
well receive the FALL-THRU-ERROR message when you execute the MMP. This is to prevent more serious consequences, such (cont.)
as causing the TP Monitor to abend, or go to EOJ.
###
Online Insertion Point
%SUBRTNM
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- before ZZ999-STOP-RUNAWAY
Description:
This insertion point is positioned near the very end of the MMP. It is a convenient place to insert miscellaneous subroutines which can be PERFORM'd from any other point in the program.
Suggested Uses:
Entire routines, including all paragraph names and exits can be inserted here and PERFORM'd from anywhere else.
This is handy when converting to MAGEC from "native" programs which contain sections of coding which you wish to (cont.)
retain. One example might be a complex cross-field edit routine, another might be a large calculation routine. You can (cont.)
insert virtually an entire program here, then in the %PFKEYM (or %PFKEYL) insertion point you could PERFORM it and GO (cont.)
TO AA900-GOBACK. This would effectively override the entire logic of the MMP with your own. You would most likely do (cont.)
something like that for a special function code which you might have added to the MMP in the %FUNCT insertion point in (cont.)
addition to the standard nine functions MAGEC generates.
%SUBRTNM and %SUBRTNL are functionally equivalent in MODELMMP
Cautions:
If your coding contains an error which causes it to bypass the EXIT (or implied EXIT) of a routine, then you might very (cont.)
well receive the FALL-THRU-ERROR message when you execute the MMP. This is to prevent more serious consequences, such (cont.)
as causing the TP Monitor to abend, or go to EOJ.
###
Online Insertion Point
%UPDAT
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- AAM720-UPDATE-DATABASE
Description:
This logic is executed only for CHG-FUNCTION's and only in the CONTINUATION-MODE and only if the ERROR-FOUND condition (cont.)
has not been set. The ERROR-FOUND condition is ordinarily set by either MAGEC Automatic Editing or by your logic in the (cont.)
%EDIT insertion point if screen data fails validity tests or for other reasons.
The purpose for %UPDAT logic is to do the actual I/O to update the database for the Primary Data Class' Elements.
The default logic calls the MAGEC I/O module with the command "UPDAT" and then exits to AAM750-TEST-RETURN-CODE.
Suggested Uses:
You may need, sometime, to override the default logic entirely with your own coding to access a non-MAGEC file or database.
You may wish to merely modify the default logic so as to post to some log or control record just before or after the UPDAT occurs.
You may wish to make some last second (micro-second) alterations to the record (Elements) being updated, such as (cont.)
posting to some fields to indicate the exact date and time that certain values were updated in the record (if they were (cont.)
altered in this update).
Cautions:
Be sure you exit to AAM750-TEST-RETURN-CODE. If you access a non-MAGEC file then you should set the field (cont.)
TWA-DB-RETURN-CODE appropriately to indicate the success or failure of your update: a value of SPACES indicates (cont.)
success, a value of '14' indicates failure. This allows the subsequent MMP logic to flow normally.
The data in AUDIT-STAMP will be filled in by the MAGEC I/O module when it is called. The contents are unreliable before (cont.)
the call. They are also unreliable if the Primary Data Class does not have Audit-Stamp support or if you do non-MAGEC (cont.)
I/O.
###
Online Insertion Point
%UPDERR
Found in Model:
MODELMMP MODELWIN
Location:
PROCEDURE DIVISION -- AAM751-UPDERR
Description:
This logic is executed when a serious error is encountered while attempting to do an update, add, or delete operation to the database or file.
It is executed only for ADD, CHG, DEL, and DUP type functions and only in CONTINUATION-MODE.
The default logic for %UPDERR simply MOVE's the DB-ERR-MSG to the screen in SCOMPL and GO's to AA800-SEND-SCREEN.
Suggested Uses:
You might (not likely) want to try your own recovery procedure for failed updates.
Cautions:
Update failures are more often than not the result of errors in your program rather than actual file errors. True file (cont.)
errors are normally handled by the MAGEC I/O module which aborts the task without even passing control back to your (cont.)
program.
###
Online Insertion Point
%USRAREA
Found in Model:
MODELMMP  MODELWIN
Location:
LINKAGE SECTION -- after TWA
Description:
This insertion point is provided so that you can add your own Cobol '01-levels' into the LINKAGE SECTION.
The default logic for %USRAREA is a comment line.
Suggested Uses:
If you are using IMS or DLI (low-level), then you will need to define PCB's here. You must also initialize the USER-BLL cells accordingly.
If you would like to access the CICS TCTUA area, then this is where you would place your definition. Initializing the BLL CELL is your responsibility.
Cautions:
Referencing an '01-level' in the LINKAGE SECTION without properly establishing adressability (loading the BLL CELLs) (cont.)
will cause unpredictable results, including, sometimes, unexplained crashes of the TP Monitor which are nearly (cont.)
impossible to debug.
###
Online Insertion Point
%VARSTOR
Found in Model:
MODELMMP MODELWIN
Location:
LINKAGE SECTION -- VARIABLE-STORAGE
Description:
This insertion point is located at the very end of VARIABLE-STORAGE. It enables you to insert your own work fields and variables.
VARIABLE-STORAGE is a Cobol 03 level group item. The MMP MOVE's LOW-VALUES to it in the initialization routine for every transaction.
Suggested Uses:
You can add Cobol data definitions to the VARIABLE-STORAGE area by using Cobol levels 04 and higher. They will then be initialized to LOW-VALUES for you.
You can add an item with a Cobol level 03 here. It will not be a part of VARIABLE-STORAGE. It and all that follows it (cont.)
will not be initialized. They will not be passed from transaction to transaction either, their contents will be (cont.)
entirely random each time the MMP is entered. It is up to you to initialize these areas (in %INIT) if (cont.)
necessary.
Cautions:
Packed or zoned-decimal numerics should be initialized by you to avoid data exception abends.
This area is part of the TWA. There is a maximum size for the TWA specified by your installation, it is something between 16K and 32K, check with your Systems Programmers if in doubt.
###
Batch Insertion Point
%ACCUMS
Found in Model:
MODELRPT
Location:
WORKING-STORAGE -- under ACCUMULATORS-AREA
Description:
This insertion point allows you to add your own custom coding into the array of accumulators, after the generated "buckets".
Suggested Uses:
You could define some of your own accumulator buckets which you could add into in the %ADDTOT and %ROLLAC insertion points.
You could insert an "01-level" to redefine the entire accumulator table. The table contains all the accumulator buckets (cont.)
plus the control fields to specify whether each level of breaks is to have totals printed for, page ejects before and (cont.)
after, and the heading to appear on the report at each break level.
Since this is at the end of WORKING-STORAGE, you can add as many of your own areas (starting with an 01-level) as you like.
Cautions:
Watch out for corrupting the numeric accumulators with non-numeric data if you redefine the table. The VERIFY option (cont.)
does not check for bad data in the accumulators, it assumes that all data will always be valid. Bad data in the table (cont.)
will likely cause the program to abend with a "data exception".
The number of accumulator levels (occurrences) will vary from program to program, depending on the number of control (cont.)
breaks specified. Changing the number of control breaks for a given program will alter the number of occurrences (cont.)
generated. The major break level is always (001); the lowest break level can be referenced symbolically as (&LVL). The (cont.)
grand total accumulators can be referenced symbolically as (&OCR). These symbolic occurrence numbers will be resolved (cont.)
by MBPCRE as the program is being generated.
Be careful not to reference an occurrence greater than (&OCR) since that will likely access the beginning of your PROCEDURE DIVISION!
###
Batch Insertion Point
%ADDTOT
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- CA130-ADD-TOTALS
Description:
This logic will be inserted after the generated code which adds to the low-level ("minor" control break level) (cont.)
accumulators from the sorted logical record. The logical record is the result of joining selected data items from all (cont.)
the input files. The code you insert in %ADDTOT is before the data is moved to the detail print (cont.)
line.
Suggested Uses:
You could accumulate your own special totals here in addition to the ones MAGEC will provide.
You could alter the data in the logical record. Since this insertion point is before the MOVE's to the detail print line, that would alter the data shown on the report.
Since this insertion point is just after the standard generated detail-level accumulators, you could also alter the accumulated figures here.
Cautions:
Watch out for clobbering numeric data items (in the sorted logical record) with non-numeric data. If you did not use the VERIFY option, non-numeric data will cause a "data exception" abend.
Do not try to MOVE into the print line (WS-DETAIL-LINE) since the generated logic will MOVE SPACES to it immediately after your %ADDTOT logic, before it MOVE's the data items to it.
###
Batch Insertion Point
%BREAKS
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- CA115-CHECK-FOR-BREAKS
Description:
This logic is inserted immediately before the generated logic which tests for control breaks.
Suggested Uses:

next: insert07.md.txt