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
             
Code to be inserted after the standard code used to initialize the screen fields' attributes for the maintenance (cont.)
functions, perhaps to protect or darken some fields based on which function or operator.
%NKLOC
             
Code to REPLACE the entire browse functions NORMALIZE KEY routine.
%NORMKEY
             
Code to be inserted after the standard logic of the maintenance functions' NORMALIZE KEY routine, perhaps to add some more key editing.
%BLNKSCR
             
Code to be inserted after the standard logic for initializing the maintenance screen's variable fields to underscores, (cont.)
perhaps to set default values into them. Used for ADD function and on NOT-FOUND condition for other (cont.)
functions.
%COMP
             
Code to be inserted after the logic to move data to the maintenance screen for display, perhaps to compute some additional values to be dispalyed.
%DELEDIT
             
Code to verify that it is OK to allow the deletion of the Primary Data Class' data. Often used to call MAGECIO to read subordinate Data Class to see that there are no subordinate records on file.
%EDIT
             
Code to do custom editing of screen data to validate it before allowing ADD, CHG, or DUP functions to update the Primary Data Class' record.
Procedural and data access (cont.)
%EDIT2
             
Code for additional edits which will only be executed if ALL edits in %EDIT and ALL automatic MAGEC edits have been (cont.)
passed already. Used to optimize efficiency of editing, by saving less efficient edits till all others have been (cont.)
satisfied.
%ADDINIT
             
Code to initialize the Primary Data Class' element(s) before the standard moves to build a new record for an ADD function.
%CALC
             
Code to be inserted after the standard moves to build/rebuild the record data for ADD, CHG, and DUP functions.
%SELECT
             
Code to determine whether each record read is to be shown on the browse displays or bypassed or if END-OF-DATA is to be (cont.)
simulated. Often used to bypass records on the file which are a different format (headers, details, and trailers, for (cont.)
instance).
%LOCMOV
             
Code to be inserted after the moves to build the display line for the browses. Used to move additional data to the display or to alter what was moved (translate codes, expand abbreviations, etc.)
%SKEYBLD
             
Code to REPLACE entirely the routine which builds the expanded key value to be moved to SKEY when the operator cursor selects an item on a browse screen.
%JOIN
             
Code to read secondary Data Classes after each read of the Primary Data Class. Also used for calculations to build (cont.)
non-file data to be dispalyed, or to inspect and to possibly modify the data just read.
%SUBRTNL
             
Obsolete (release 1.0 thru 1.3), same as %SUBRTNM.
%SUBRTNM
             
Code for miscellaneous subroutines which may be PERFORM'd from any other Insertion Point's coding.
##
Alphabetical List of Insertion Points
%ADDINIT
             
Code to initialize the Primary Data Class' element(s) before the standard moves to build a new record for an ADD function.
%ADDIT
             
Code to override the logic to add a record to the Primary Data Class.
%BLNKSCR
             
Code to be inserted after the standard logic for initializing the maintenance screen's variable fields to underscores, (cont.)
perhaps to set default values into them. Used for ADD function and on NOT-FOUND condition for other (cont.)
functions.
%CALC
             
Code to be inserted after the standard moves to build/rebuild the record data for ADD, CHG, and DUP functions.
%COMP
             
Code to be inserted after the logic to move data to the maintenance screen for display, perhaps to compute some additional values to be dispalyed.
%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.
%DELEDIT
             
Code to verify that it is OK to allow the deletion of the Primary Data Class' data. Often used to call MAGECIO to read subordinate Data Class to see that there are no subordinate records on file.
Alphabetical List (cont.)

next: cstm16.md.txt