it by overkeying, if you like, and press ENTER to add it to the dictionary as
**customization code to be inserted into the program.
##
Your Own Proformas
When MAGEC is installed, it includes a set of Named Proformas which most users find to be helpful. These include such (cont.)
things as SQL, IMS/DLI, and other database access calls. You are free to use these in any applications where (cont.)
appropriate. You can also modify or delete them, or add your own Named Proformas via the online and/or batch facilities (cont.)
provided.
The online functions used to do this are:
PROADD mmmmmmmm/nnnnnnnn
 
 
PROCHG mmmmmmmm/nnnnnnnn
 
 
PRODEL mmmmmmmm/nnnnnnnn
 
 
PROSEE mmmmmmmm/nnnnnnnn
 
 
PRONXT mmmmmmmm/nnnnnnnn
 
 
PROLOC 1/mmmmmmmm/nnnnnnnn
 
 
The key in all cases consists of the 8-character member name (mmmmmmmm) followed by the 8-character modifier (cont.)
(nnnnnnnn). In the PROLOC function the key may be incomplete or just "1". Named Proformas are very similar to any other (cont.)
library member except that they are limited in size to one screenful, 15 lines, of code. You can make up names for them (cont.)
which help the developer identify what they do. For example, if you were adding a Named Profroma to call your "home (cont.)
grown" rate calculation subroutine, you might name it "RATE/CALC". You would add it to the dictionary using the (cont.)
command:
PROADD RATE/CALCYou can use the MAGECLBR batch utility program to add, replace, list, or punch out Named Proformas using the control cards:
-MAGECADD PRO mmmmmmmm/nnnnnnnn
 
 
-MAGECREP PRO mmmmmmmm/nnnnnnnn
 
 
-MAGECLST PRO mmmmmmmm/nnnnnnnn
 
 
-MAGECPUN PRO mmmmmmmm/nnnnnnnn
 
 
-MAGECPUN PRO
 
 
where:
mmmmmmmm
             
= 8-character member name
nnnnnnnn
             
= 8-character modifier
If you use the -MAGECPUN PRO with the member and modifier names omitted then the program will punch out all the Named (cont.)
Proformas with separator control cards between them. The separators are actually -MAGECREP control cards so that the (cont.)
output can be turned around and used as input to MAGECLBR to recatalogue the members. This facilitates exporting them (cont.)
to another text editor, modifying them, and importing the results back to the MAGEC dictionary.
#
Modifiers & Page Numbers
##
ALG Key Structure
In all the examples we have used so far the key structure for the Customization Algorithms has only contained two components. For example:
600/EDIT
 
where:
600
             
= Mask "number"
EDIT
             
= Insertion Point name
Actually there are four (4) components to the key. The other two assume default values, if we do not specify them, such as:
600/EDIT/mmmmmmmm/ppp
 
 
where:
600
             
= Mask number
EDIT
             
= Insertion Point name
mmmmmmmm
             
= Modifier
ppp
             
= Page number
The Modifier (8-character) is optional and will default to spaces if you do not enter it. The Page number (3-digit) is also optional and will default to zeros if you do not enter it.
When MMPCREAT is inserting your Custom coding, it seeks all the records from the Library having a key in which the Mask (cont.)
number and the Insertion Point name match the Mask number and Insertion Point being processed. MMPCREAT considers the (cont.)
Modifier and Page numbers as comments and does not look at them. Therefore, if you have several "pieces" of Custom (cont.)
coding on the Library, such as:
600/EDIT/AMOUNTS/001
 
 
600/EDIT/AMOUNTS/002
 
 
600/EDIT/STATUS
 
 
MMPCREAT will insert all three of these records' code into the Insertion Point %EDIT for Mask 600. They will be (cont.)
inserted in the order they are read from the Library (the order shown above). In columns 73 - 80 in the Cobol listing (cont.)
you would see literals displayed telling you exactly which Customization Algorithm you are looking (cont.)
at.
You can have up to 1000 "pages" (records) for a given unique Insertion Point/Modifier name. Each page can contain up to 15 lines.
The Modifier names can be useful to you online when you are coding or maintaining your Customization. Instead of having (cont.)
one very large "lump" of code for, say %EDIT, you might prefer to have several smaller pieces which you can manipulate (cont.)
individually and which you can access directly by name. The choice is yours.
NOTE:**
Mask numbers must be three (3) characters, with the first character a numeric digit and the other two characters either alphabetic or numeric (i.e. 9XX).
#
Sample Project 3
##
Adding a Custom Function
For the third project, we will add a new function, a tenth function which this MMP will support in addition to the nine (cont.)
standard ones. The new function will be a variation of the Browse. It will sequentially read through all the VAC (cont.)
records tallying the total number of days due for Vacation, Sick, and Comp days for all employees.
This new function will not display the detail like the ordinary browse (VACLOC) does. It will only display the (cont.)
total-for-all-employees figures. We can expect that this function will execute a bit slower than the others since it (cont.)
must always start at the first employee and read all the way to the last before it can present a (cont.)
screen.
The MAGEC Security System controls access to each Function Code, not just to a Program. Even though our Vacation MMP (cont.)
(MMP600) is now going to be processing ten different functions you can still have entirely separate and different (cont.)
security parameters for each function if need be. Just because a particular operator might be allowed to do the VACLOC (cont.)
or VACSEE function does not mean that you must allow him/her to do the new function.
We will name the new function "VACTOT". We will not require the operator to enter any key value (Employee#) into SKEY (cont.)
after the Function Code since we know that we must always begin at the very first Employee#. We will force *a key value (cont.)
of "000000000" in the MMP.
In this project we will be doing Cobol Customization coding into some new Insertion Points. You may wish to have the (cont.)
chapters, MAGEC "Analysis of the Generated MMP" and MAGEC "Insertion Points" handy. They list all the Insertion Points (cont.)
by their actual names (%EDIT, etc.) and direct you to the place in the generated MMP where each exists. You may also (cont.)
refer to "Appendix H in this chapter, which lists all the Insertion Points and briefly describes their (cont.)
use.
##
New Function Code
If you examine the Cobol listing for MMP600 you will notice that there is an Insertion Point named **%FUNCT**. You will (cont.)
also notice that there is Default coding inserted there. The Default coding lists all the existing nine Function Codes (cont.)
as valid values in "88-levels".
The first thing you must do is to add your new VACTOT Function Code to this list.
In the Proforma which you will see for %FUNCT you will notice the symbolic parameter (&PFX) throughout. When MMPCREAT (cont.)
generates your MMP it will replace the characters (&PFX) with the Function Code Prefix. The Function Code Prefix was (cont.)
specified on the Screen Header definition panel, it defaults to the name of your Primary Data Class (VAC). Thus, the (cont.)
functions for this application are generated as: VACADD, VACCHG, etc.
You will need to make entries in two places on the %FUNCT Proforma since every Function Code is defined once in the list of valid functions and once below to indicate what kind of function it is.
| ```
**     DO THIS:
Enter the command: ALGADD 600/FUNCT
. . . and press ENTER.
   
```**
The ALGADD screen will appear with the Proforma for the Insertion Point, %FUNCT.
| ```
**     DO THIS:
Press ENTER again.
   
```**
You have added Custom code to the Library, it looks exactly like the Proforma so far. Next you will modify it.
| ```
**
ALGADD 600/FUNCT
SEARCH ARG: ..................................................................
Password: M A G E C FUNCT page
New Password: CUSTOM ALGORITHM DEFINITION FOR MSK 600
ADD/MODIFY FUNCTION CODES TAB Option (PF14=ON/OFF): ON
....+..;10.;..+;..20....+...30....+...40...;+...50....+...60....+...70..
88 MAINT-FUNCTION VALUE '&PFXADD' '&PFXCHG' '&PFXDEL' 01
'&PFXSEE' '&PFXNXT' '&PFXDUP'. 02
88 BROWS-FUNCTION VALUE '&PFXLOC' '&PFXSCN' '&PFXFND'. 03
05 FILLER REDEFINES TEST-FUNCT. 04
07 TEST-FUNCT-KEY PIC XXX. 05
07 T-FUNCT PIC XXX. 06
88 SEE-FUNCTION VALUE 'SEE' 'NXT'. 07
88 NXT-FUNCTION VALUE 'NXT'. 08
88 ADD-FUNCTION VALUE 'ADD'. 09
88 CHG-FUNCTION VALUE 'CHG'. 10
88 DEL-FUNCTION VALUE 'DEL'. 11
88 DUP-FUNCTION VALUE 'DUP'. 12
88 LOC-FUNCTION VALUE 'LOC'. 13
88 SCN-FUNCTION VALUE 'SCN'. 14
88 FND-FUNCTION VALUE 'FND'. 15
Move CURSOR to a line, use ERASE EOF to Delete it -or- PF20 to Insert After it
Semicolon (;) is the TAB Character Asterisk (*) in col. 1 = suppress upcase
Press PF24 for Instructions Press PF4 for Menu of Named Proformas
```**
Figure 29 -- Proforma for %FUNCT
##
Inserting New Function
The ALGSEE screen now shows the Custom code on file for %FUNCT.
You must alter it to correctly define the nine existing Function Codes *plus* your new VACTOT function. You must:
1.
Add a new entry for BROWS-FUNCTIONS (it will look like: &PFXTOT).
2.
Add TOT as a valid suffix which is equal to the LOC function (standard browse).
3.
Remember to remove the period from the end of line 03 and add a period after the new function you have added to the list.

next: cstm09.md.txt