In order to assist you in keying in your Custom Code MAGEC provides a "Proforma" on the screen whenever you do the (cont.) ALGADD function. A Proforma is simply an example of what your coding might look like for that particular insertion (cont.) point. The Proforma for any given insertion point would, of course, be different from the Proforma for another. There (cont.) is a Proforma for every insertion point. It is only seen when you do the ALGADD function to add new Custom (cont.) code. When you use the ALGADD function, MAGEC presents a screen ready for you to key your Cobol code into. Instead of just (cont.) presenting a "blank" screen, however, it presents a screen on which the appropriate Proforma is shown. In some cases (cont.) the Proforma could be used as a fill-in-the-blanks coding aid; you could just overkey what you wish to be different (cont.) from what is shown and leave the rest alone. When you press ENTER to let ALGADD actually add the code, it will take (cont.) whatever is on the screen at that time. You can always update it again, of course. The figure on the opposite page shows how the screen would be presented to you if you were **adding Customization for (cont.) %EDIT. When you are coding Custom editing to be done in the BB500-SCREEN-EDIT routine there are certain conventions you (cont.) should follow: Set the Error-Flag for the offending screen fields to "E" so they will automatically be highlighted. Move the appropriate error number to ERROR-NUMBER. PERFORM the CA100 routine. Since you will almost always want to follow that convention, we have established a Proforma for %EDIT which will (cont.) minimize the keystrokes you need to do. You can just overkey the displayed code (especially where the dashes are (cont.) shown). You could still overkey the entire Proforma with your own completely different code it you wished, but most of (cont.) the time the Proforma will reduce your work and keying errors. Proforma code exists solely to help you when keying in your Custom coding. It is merely something that MAGEC (ALGADD) (cont.) places on the screen to save you as many keystrokes as possible. It does not come from the Library, it is placed on the (cont.) screen for you from the ALGADD program. Many users find that the easiest and most flexible way to use the Proforma is as follows: 1) Key in ALGADD command - proforma is displayed 2) Press ENTER - proforma is added to Library as Custom code 3) Overkey changes - 4) Press ENTER - custom code is updated on Library Note:** For most of the coding you will do in %EDIT you will simply have to overkey the dashed areas (---) and press (cont.) ENTER. For the rare exceptions you can overkey the entire screen with any other coding you desire. It is perfectly okay (cont.) to use the ERASE EOF key on your keyboard to delete lines. Blank lines will be "squeezed out" (cont.) automatically. This Proforma shows an example of the coding for both a fatal error and a warning-level error. You choose the one appropriate for your edit and erase the other using the ERASE-EOF key. ``` ALGADD 600/EDIT ** SEARCH ARG: ........................................................... ........ Password: M A G E C EDIT page New Password: CUSTOM ALGORITHM DEFINITION FOR MMP600 SCREEN FIELD EDIT(S) TAB Option (PF14=ON/OFF): ON ....+..;10.;..+;..20....+...30....+...40....;+...50....+...60....+...70.. *-*-* CHECK FOR A FATAL ERROR 01 02 if -------------------- 03 move e to s------e 04 move '---' to error-number 05 perform ca100-load-err-code-tbl thru ca199-exit. 06 07 08 *-*-* CHECK FOR A NON-FATAL (WARNING) CONDITION 09 10 if -------------------- 11 move e to s------e 12 move '---' to error-number 13 perform ca400-load-warning-to-tbl thru ca499-exit. 14 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 27 — Proforma Code for %EDIT ## Another Proforma Example In the case of the %REDKY insertion point, and many others, your Custom Code will usually be very similar to the (cont.) Default Code with only minor changes or additions. For that reason you will notice that the Proforma looks just like (cont.) the Default Code; you can simply overkey any changes or insert any additions. This saves you from having to rekey the (cont.) entire Default routine with only a few changes. You can, if you need to, overkey the entire Proforma and thus replace (cont.) the Default Code with an entirely different routine. This will be necessary only very rarely, maybe (cont.) never. You will find that the technique of first pressing ENTER to add the Proforma code to the Library and then overkeying, (cont.) inserting, and deleting lines to modify it is especially useful here. When you press ENTER to initially add the code to (cont.) the Library you will notice the function code on the top line of your screen change from ALGADD to ALGSEE. The PF keys (cont.) to insert lines, etc, do not work in the ALGADD function, they do work in the ALGNXT, ALGSEE, and ALGCHG functions. If you look at the Cobol listing of the MMP before Customization was done for the %REDKY insertion point you would see (cont.) the Default code that MAGEC inserted there. If you were to compare that Default code to the Proforma for %REDKY you (cont.) would notice that they are nearly identical. That is because you usually need to deviate only slightly from the Default (cont.) logic here, perhaps to insert a few lines of code just before or just after the CALL to MAGECIO. If there were no (cont.) Proforma on the screen then you would have to key in the whole routine yourself. Remember, the Proforma is only presented when you are doing the ALGADD function, not when you are doing ALGNXT or ALGCHG, etc. Once you have added code to the Library using ALGADD you can then modify, add to, or delete it without restrictions. Note:** In order to assist you to discern which portions of the proforma are duplicates of the default code, MAGEC (cont.) displays those portions in all uppercase. In many cases you will notice that some lines are in uppercase with some (cont.) lines in lowercase. The lowercase lines are merely suggested code to show you what might be done (cont.) here. You have the ability to overkey, or delete, any lines of the proforma, whether they are shown in uppercase or lowercase. This is just to help you to see the default coding you are customizing. ``` ALGADD 600/REDKY ** SEARCH ARG: ................................................................ ... Password: M A G E C REDKY page New Password: CUSTOM ALGORITHM DEFINITION FOR MSK600 READ FOR DISPLAY ROUTINE TAB Option (PF14=ON/OFF): ON ....+..;10.;..+;..20....+...30....+...40...;+...50....+...60....+...70.. PERFORM BA500-CHECK-FSTAT THRU BA599-EXIT. 01 IF (FILE-CLOSED) 02 GO TO AA900-GOBACK. 03 MOVE REDKY TO TWA-DB-CMD. 04 MOVE THIS-PGMS-ELEMENTS TO TWA-ELT-LIST. 05 CALL 'MAGECSET' USING TWA-DB-AREA-A 06 &ELTSET 07 PERFORM AA840-CALL-MAGEC-IO THRU AA899-EXIT. 08 MOVE AUDIT-STAMP TO SAVE-AUDIT-STAMP. 09 PERFORM JA100-LOGICAL-JOIN THRU JA199-EXIT. 10 11 12 13 14 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 28 — Proforma for %REDKY # Named Proformas ## The PF4 Key Whenever you are doing the ALGADD function MAGEC presents a Proforma on the screen to help minimize your keystrokes (cont.) (and opportunities for errors). The choice of which Proforma to present is based upon the insertion point (EDIT, REDKY, (cont.) etc.) you are adding code for. In most cases the Proforma initially presented will be appropriate for what you are (cont.) trying to do. However, in some cases, it might not be. If you believe that there might be a more useful Proforma than (cont.) the one on the screen, you can press PF4 to request a menu (list) of "Named Proformas" to choose (cont.) from. This PF4 facility is available only for the ALGADD function. When you use it you will be presented a screenful of (cont.) choices. Named Proformas are identified by an 8-character member name plus an 8-character modifier, much like ordinary (cont.) library members (refer to the "Librarian" chapter). You can select one by positioning the cursor on it and pressing (cont.) ENTER; it will then be displayed on your screen in lieu of the one which was previously being displayed. You can modify (cont.) 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.) Next: https://magec.com/DOC/markdown/cstm07.md.txt