MAGEC, they already abide by this restriction. It is only in your customization where you are likely to cause a (cont.) problem. # Appendix D -- Exit to Logo Screen ## Fetching the Clear Screen Sometimes you will have occasion to add Customization coding to cause your MMP to just terminate its processing and (cont.) pass control to the "Logo screen". The Logo screen is also called the "Clear screen", it is the screen on which either (cont.) the MAGEC logo or your company's logo is displayed. It also has a message on line 2 of the screen saying: "ENTER (cont.) FUNCTION CODE". To fetch the Clear (Logo) screen, code: MOVE FTH-FUNCT TO TWA-NONTP-REQUEST. MOVE CLEAR-FUNCT TO SFUNCT. GO TO AA900-GOBACK.You must not GO TO AA900-GOBACK from within a PERFORM'ed routine.You can also fetch the Clear screen (cont.) and specify a message to be shown in the SCOMPL screen field (top line, right half), code:   MOVE MSG-LIT TO TWA-TP-OP. MOVE message TO TWA-MSK-AREA. MOVE FTH-FUNCT TO TWA-NONTP-REQUEST. MOVE CLEAR-FUNCT TO SFUNCT. GO TO AA900-GOBACK.   where: 'message'               = any 40-character literal. # Appendix E -- Setting Error Number ## Editing When MAGEC does its Automatic Editing for your screen fields it sets standard Error Numbers which cause the (cont.) corresponding Error Messages to be displayed on the last three lines of the screen. If you do any Custom coding and add (cont.) some editing of your own you should follow the same convention. The Automatic Editing also flags which screen fields are in error, so that they will be automatically altered to (cont.) "highlighted" on the screen. This means that they will appear either double brightness or in a highlight color (red) (cont.) for easy identification. To set the Error Number and flag a screen field as being in error, enter coding as follows: IF Sfield -----error condition--------- MOVE E TO SfieldE MOVE 'nnn' TO ERROR-NUMBER PERFORM CA100-LOAD-ERR-CODE-TBL THRU CA199-EXIT.   where : Sfield               = the name of a screen field 'nnn'               = an Error Number which is defined on the MAGEC ERR file. In the %EDIT Insertion Point this code will cause the MMP to bypass updating the file(s) and just return to MAGECCP to have the Error Messages issued. If you wish to flag a non-fatal (warning level) error, code: IF Sfield -----error condition--------- MOVE E TO SfieldE MOVE 'nnn' TO ERROR-NUMBER PERFORM CA400-LOAD-WARNING-TO-TBL THRU CA499-EXIT.   The above code will allow the MMP's updating to occur, but will tell MAGECCP to also place the specified Error Message into the screen. # Appendix F -- Defining Error Numbers ## Adding & Updating to ERR File The Error Numbers and Error Messages which MAGEC places into the last three lines of the screen (SERRMSG) are defined (cont.) on the ERR file. Error Numbers are 3-character, alpha-numeric codes. The "numbers" which start with "9" are reserved (cont.) for MAGEC system use, you can use any other Error Numbers for your own applications. To add a new Error Number online, enter the command: ERRADD nnn where nnn = the 3-character Error Number you wish to add, then press ENTER. The ERRADD screen will be presented. You must enter two things: a 33-character Error Message up to 4-lines (320-character) of narrative "HELP" text # Appendix G -- Coding for PF Keys ## How to Test Which Key Was Hit The 3270 terminals have (depending on the model) up to 24 PF keys which the operator can press instead of just pressing (cont.) the ENTER key. The PF keys send the data to the CPU just like the ENTER key does, thus there are 25 keys the operator (cont.) can use to send the screen data. The CLEAR key, the PA keys and the TEST key do not count since they do not send the (cont.) screen data, just a one-byte code. You can use the PF keys to make your application much more "user friendly" since it is obviously easier to press a PF (cont.) key than to type something on the screen and press ENTER (fewer keystrokes). Some PF keys are already being used for (cont.) built-in features. For instance, PF9 is used to Swap Windows, PF15 exits MAGEC, etc. The rest are available for you to (cont.) use as you see fit in each application. To test which key was used, code: IF (TWA-MSK-PF1-HIT) ..... IF (TWA-MSK-ENTER-HIT) ..... IF (TWA-MSK-PF10-HIT) ..... - etc.   You can do this at any time in the processing logic. There is an 88-level value for every possible key. ## Simulating a Key Sometimes you may need (or want) to "fool" your program (or one that you transfer to) into "thinking" that a different (cont.) key was pressed that what actually was pressed. An example of such a case is when you have two screens which allow the (cont.) user to transfer back and forth using the same key (for instance PF2). Each program would test for PF2 and would, if (cont.) PF2 was hit, transfer to the other. Before actually transferring, however, it should reset the indicator to something (cont.) other than "PF2" in order to prevent a loop in which each program senses PF2 and transfers to the other infinitely. The (cont.) most common thing to do is to set the indicator to say that ENTER was pressed, as: MOVE QUOTE TO TWA-MSK-AID. You can set other values to indicate other keys, as well. The TWADSC-C copybook contains a list of all possible keys and their associated values, if you are interested. # Appendix H -- Insertion Points ## Where to do Customization Below is a list of the Customization Insertion Points where you can enter Custom coding. Beside each is a brief (cont.) description of some of the most common types of coding done there. This list is organized following the sequence found (cont.) in a generated program. An alphabetical list of Insertion Points begins on page I-4. CommentsY = %REMARKS               Comments to be inserted into the REMARKS section of the Cobol MMP. Define data and working areas %LOCLITS               Obsolete (release 1.0 thru 1.3), same as %Literal. %LITERAL               WORKING-STORAGE constants with VALUE clause. %DATADEF               MAGECINC's for secondary Data-Class's elements. Work areas to be saved or passed to another (FTH'd) function (MMP) or to the next transaction at this terminal. %FUNCT               Code to override the standard list of Function codes for this MMP. %LOCVARS               Obsolete (release 1.0 thru 1.3), same as %VARSTOR. %VARSTOR               Definitions of work fields to be used by the MMP. These will be inserted into the VARIABLE-STORAGE area of the TWA and (cont.) will be initialized to LOW-VALUES immediately upon entry of each transaction. Data in this area cannot be passed to (cont.) another MMP or transaction, it is not saved. %USRAREA               Used for user defined LINKAGE-SECTION areas. Possibly used for IMS PCB's or CICS TCTUA. Each of these items should begin with an "01" level entry. Procedural and data access %PREINIT               Code at the top of the Procedure Division before the Mask Initialization record has been read and before any data manipulation by the MMP. %PFKEYL               Code to be inserted at the very start of the mainline logic for browse functions. May be used to test for PF keys or to (cont.) alter the key value which the Operator entered, possibly to prefix a Client#, etc. %LOCKY               Code to override the logic used to start a browse (generically), possibly to force a certain starting key value, or to code the I/O access bypassing the MAGEC I/O module (Primary Data-Class). %REDLE               Code to override the logic for reading the first record after starting a browse via the %LOCKY coding (Primary Data-Class). %REDNX               Code to override the logic for reading the Primary Data-Class "sequentially". Inserted into BOTH the browse and maintenance mainline routines. %PFKEYM               Code to be inserted near the beginning of the mainline logic for maintenance functions. May be used to test for PF keys (cont.) or to alter the key value which the Operator entered, possibly to prefix a Client#, etc. Procedural and data access (cont.) %REDKY               Code to override the logic for reading the Primary Data Class randomly (by key). %RDUKY               Code to override the logic for reading the Primary Data Class randomly (by key) with intent to update or delete the data. %ADDIT               Code to override the logic to add a record to the Primary Data Class. %UPDAT               Code to override the logic for updating a record of the Primary Data Class. %DELET               Code to override the logic for deleting a record from the Primary Data Class. %RELES               Code to override the logic for dropping the "exclusive control" obtained via logic in the %RDUKY insertion point. %UPDERR               Code to override the logic used when a bad return code is sensed for %UPDAT, %DELET, or %ADDIT logic. %GOODADD               Code to override logic used when a good return code is sensed from %ADDIT logic, perhaps to update other Data Class(es). %GOODCHG               Code to override logic used when a good return code is sensed from %UPDAT logic, perhaps to update other Data Class(es). %GOODDEL               Code to override logic used when a good return code is sensed from %DELET logic, perhaps to update other Data Class(es). %SNDSCRN               Code to be inserted just before the logical end of processing for all functions. It will be executed just before the MMP returns to MAGECCP to have the screen sent. %LOCINIT               Code to be inserted into the initialization routine for the browse functions, to initialize packed fields in VARIABLE-STORAGE, to override default values. %INIT               Code to be inserted into the initialization routine for maintenance functions, to initialize VARIABLE-STORAGE fields, etc. %INITATB               Next: https://magec.com/DOC/markdown/cstm12.md.txt