Online Insertion Points
Online Insertion Point Cross Reference
Insertion Point Name | Maintenance | BROWSE | Remarks |
New Trans Mode | Continuation Mode | New Trans | Continuation |
ADD | CHG | DEL | SEE | ADD | CHG | DEL | NXT | DUP | LOC | SCN | FND | LOC | SCN | FND |
ADDINIT | | | | | X | | | | X | | | | | | | Only if no error found ADDIT | | | | | X | | | | X | | | | | | | Only if no error found BLNKSCR | X | | | | | | | | | | | | | | | Also if Invalid Key or NOT-FOUND CALC | | | | | X | X | | | X | | | | | | | COMP | X | X | X | X | | | | | | | | | | | | Only if REC-FOUND DATADEF | | | | | | | | | | | | | | | | Linkage Section DELEDIT | | | | | | | X | | | | | | | | | DELET | | | | | | | X | | | |
| | | | | Only if no error found EDIT | | | | | X | X | | | X | | | | | | | EDIT2 | | | | | X | X | | | X | | | | | | | If no error found in %EDIT FUNCT | | | | | | | | | | | | | | | | Linkage Section - 88 levels GOBACK | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | GOODADD | | | | | X | | | | X | | | | | | | If ADDIT is successful GOODCHG | | | | | | X | | | | | | | | | | If UPDAT is successful GOODDEL | | | | | | | X | | | | | | | | | If DELET is successful INIT | X | X | X | X | X | X | X | X | X | | | | | | | INITATB | X | X | X | X | X | X | X | X | X | | | | | | | JOIN | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | LITERAL | | | | | | | | | | | | | | | | Working-Storage Section LOCINIT | | | | | | | | | | X | X | X | X | X | X | LOCKY | | | | | | | | | | X | X | X | | | | LOCLITS | | | | | | | | | | X | X | X | X | X | X | Obsolete LOCMOV | | | | | | | | | | X | X | X | X | X | X | LOCVARS | | | | | | | | | | X | X | X | X | X | X | Obsolete NKLOC | | | | | | | | | | X | X | X | X | X | X | NORMKEY | X | X | X | X | X | X | X | X | X | | | | | | | Only if no error found in key PFKEYL | | | | | | | | | | X | X | X | X | X | X | PRKEYM | X | X | X | X | X | X | X | X | X | | | | | | | PREINIT | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | RDUKY | | | | | | X | X | | | | | | | | | REDKY | X | X | X | X | | | | | | | | | | | | REDLE | | | | | | | | | | X | X | X | | | | REDNX | | | | | | | | X | | X | X | X | X | X | X | RELES | | | | | X | X | X | X | X | | | | | | | Only if error found REMARKS | | | | | | | | | | | | | | | | Identification Division - Remarks SELECT | | | | | | | | | | X | X | X | X | X | X | SKEYBLD | | | | | | | | X | | X | X | X | X | X | X | SNDSCRN | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | SPOOL | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | If PF13 hit SCHEMA | | | | | | | | | | | | | | | | Before Working-Storage SUBRTNL | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | Only when PERFORM'd SUBRTNM | X | X | X | X | X | X | X | X | X | X | X | X | X | X | X | Only when PERFORM'd UPDAT | | | | | | X | | | | | | | | | | Only if no error found UPDERR | | | | | X | X | X | | X | | | | | | | Only if error found USRAREA | | | | | | | | | | | | | | | | Linkage Section - 01 levels VARSTOR | | | | | | | | | | | | | | | | Linkage Section - Variable Storage | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Figure 1
Online Insertion Point
%ADDINIT
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB600-BUILD-REC
Description:
-
Only used for ADD functions. This logic will be used to initialize the Record's Elements just before the individual Data Items are MOVE'd from the screen to the Elements. The default logic will just MOVE SPACES to the Elements. NOTE: it moves SPACES to all the Elements in TWA-DB-DATA, both from the primary and from joined Data Classes.
Suggested Uses:
-
Initializing numeric Data Items in the Elements to zero or to some other value. Setting default values into selected database fields which will NOT be MOVE'd to otherwise; i.e. they are not used as a Source/Target for any of the screen fields.
-
You may use this insertion point to set the "Date & Time Added" into the record, if you desire.
-
You may wish to override the default logic by moving SPACES (or other initialization value) to only the primary Data Class's Elements.
Cautions:
-
This logic will only be done for an ADD function; usually this means xxxADD or xxxDUP, unless you have added other ADD functions through customization in the %FUNCT insertion point.
-
If you MOVE a value to a Data Item which is specified as a Source/Target for a screen field; it will be overlaid when the generated MOVE's are done, immediately below in the BB600-BUILD-REC logic.
-
Do not attempt to MOVE to the Audit-Stamp. Anything you move there will be overlaid by the MAGEC I/O module since it handles all Audit-Stamp maintenance.
-
Your custom coding will replace the default MOVE SPACES. If you want the Element(s) initialized to SPACES first, you must code it in your logic.
Online Insertion Point
%ADDIT
Found in Model:
Location:
-
PROCEDURE DIVISION -- AAM710-ADD-TO-DATABASE
Description:
-
This is the logic used to add a record to the Primary Data Class (file). The default logic CALL's the MAGEC I/O module. The command used when calling the MAGEC I/O module is: "ADDIT".
Suggested Uses:
-
When you add customization for %ADDIT MAGEC presents you with Proforma code which resembles the default logic. You may modify or add to it as needed. You can also entirely replace the Proforma by overkeying it. This enables you to code the necessary commands to access a file directly instead of using the MAGEC I/O module.
-
You could code the database commands for a non-MAGEC file.
-
You could add code to update a control record just before the add to the Primary file.
-
You could access a control record to determine the next available key (such as P.O. number, Invoice number, etc.) so as to assign the key for the record you are about to add.
Cautions:
-
If you want to do something after the add is completed, this is not the best place to do it. The %GOODADD insertion point is a better place since the MMP will test for a good return code before going to %GOODADD.
-
If you do other I/O before the add, be sure to save and restore TWA-DB-REQUEST (in TWA-DB-REQ-SAV) and TWA-ELT-LIST if you "step on" them.
-
Be sure not to "step on" the Elements (in TWA-DB-DATA) for the Primary Data Class before they are added to the file.
-
Be sure the file is open and authorized for adds.
Online Insertion Point
%BLNKSCR
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB100-BLANK-SCREEN
Description:
-
Logic inserted at the very end of the "blank screen" routine, after all the standard generated MOVE's of ALL '_' to all screen variables. This is executed on the "NEW-TRANSACTION" phase of the xxxADD function and also whenever the "INVALID KEY FORMAT" message is displayed.
Suggested Uses:
-
You could initialize selected screen fields to some value other than underscores, if you wish.
-
You could move values to the screen based on the key value the operator entered. For instance, if the key value in SKEY is a Customer Number, you might read the Customer file to get the Name and Address, then move them to the screen. Actually, the read might have been done in the %NORMKEY insertion point as a custom key edit.
-
You could test for an edit failure in the key normalization (IF SCOMPLE = E) and move your own message to the screen to help the operator correct the error.
Cautions:
-
This logic is only executed in the NEW-TRANSACTION phase of the xxxADD function (and on INVALID KEY). If you want something to be done at other times also, you should probably place the logic in a PERFORM'd routine (in %SUBRTNM) and then PERFORM it from here as well as from anywhere else it may be desired (such as %CALC and %COMP).
-
This logic may, of course, not reference any screen fields in MSK652 (the Browse Mask) since it is executed only for Maint functions.
Online Insertion Point
%CALC
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB610-MOVE-SCREEN-TO-DB
Description:
-
Logic inserted at the very end of the BB600-BUILD-REC routine which MOVE's data from the screen to the database Element(s). This logic will be after all the generated MOVE's from the screen fields to the record fields, but before the MOVE of NORMALIZED-KEY to the record key and before the business rule processing.
-
BB600-BUILD-REC is executed for all database updating functions, typically xxxADD, xxxCHG, xxxDUP. It is executed only in the CONTINUATION-MODE, not in the NEW-TRANSACTION-MODE -- and only if there were no fatal errors flagged in the editing (NOT ERROR-FOUND).
Suggested Uses:
-
You can override any of the generated MOVE's here.
-
You can move to database fields which are not the Source/Target for any screen field.
-
You can do calculations or conversions to store computed values, instead of "raw" screen data, on the file. For example, converting a date to Julian (or binary) using a conversion subroutine to save file space. There is such a date conversion subroutine, named MAGDATE, available with MAGEC.
-
You can override the value in NORMALIZED-KEY which will be moved into the record's key. NORMALIZED-KEY is moved in order to prevent the possibility of your adding records without setting the key value. In some cases the value in NORMALIZED-KEY may not be what you want as the key, especially on an ADD-FUNCTION where you may wish to automatically assign part or all of the key. You can bypass the MOVE of NORMALIZED-KEY by branching around it to the business rule logic; to do so you should GO TO BB680-DATA-RULES.
Cautions:
-
On an ADD function, the data in the Element's fields will be unreliable unless you have initialized it in %ADDINIT. This is not a good place to do I/O. If you do you will have to be careful not to "step on" the TWA-DB-REQUEST area (or, at least, save and restore it). Of course, you should also be careful not to corrupt the data just MOVE'd into the Element area.
-
If you want to update another file, such as a control record, you would be better off doing so in the %GOODADD and %GOODCHG insertion points, which will be executed only if the update I/O completes successfully.
-
Remember, %CALC logic will NOT be executed for any of the Browse functions (xxxLOC, xxxSCN, xxxFND). Do not GO TO BB699-EXIT unless you intend to bypass the MOVE of the record key coded just behind %CALC and also bypass the business rule processing.
Online Insertion Point
%COMP
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB200-FILL-SCREEN
Description:
-
This logic is inserted at the end of BB200-FILL-SCREEN. It is inserted after all of the generated MOVE's from the database fields to the screen, just before BB299-EXIT.
-
This code is executed in NEW-TRANSACTION-MODE of Maint functions to MOVE data to the screen for display. It is not executed in the CONTINUATION-MODE of any function, unless you PERFORM it in customization code of your own.
Suggested Uses:
-
You can MOVE literals or COMPUTE'd values to the screen here.
-
You can "translate" codes from the file into more readable descriptions and move them to the screen, if you wish.
-
You can alter screen field 3270 Attributes based on the data being displayed; especially useful when MAGEC's Extended Color support and 7-Color terminals are being used.
-
You can MOVE data or messages to the last three lines of the screen (SERRMSG), increasing the usable display capacity of the screen.
Cautions:
-
Data displayed in SERRMSG is Display-Only. If MAGEC needs to place error messages or other notifications there, your data will be overlaid.
-
This logic is executed only for Maint functions, you may not reference screen fields in MSK652, the Browse Mask.
- If you are moving to a numeric screen field you should:
-
1) MOVE (or COMPUTE) into the "numeric equivalent" field, named S_____-N.
-AND-
-
2) MOVE to the "edit pattern" field, named S_____-ED. This will maintain the standard set by MAGEC in its generated MOVE's and will ensure agreement.
-
You should check numeric database fields (IF NUMERIC . . .) before trying to MOVE them if you are not sure of their validity. The generated MOVE's will do that if you have specified the VERIFY option.
Online Insertion Point
%DATADEF
Found in Model:
-
MODELMMP MODELWIN MODLOCAT
Location:
-
LINKAGE SECTION -- TWA-DB-DATA
Description:
-
This insertion point is immediately after the generated data definitions for the Elements specified in the Screen Header definition (SHDxxx screen). The Element definitions for any Logically Joined data will be automatically inserted in %DATADEF in the form of -MAGECINC statements. A Cobol 03-level item (TWA-DB-DATA) is the group item which includes all these Element definitions below it.
Suggested Uses:
-
You can add more data definitions for the MMP here. They may be -MAGECINC statements or straight Cobol coding. Since this area follows TWA-DB-DATA, which is a Cobol level 03, you must avoid using Cobol level 02 and 01 here.
-
TWA-DB-DATA is initialized to SPACES on ADD functions (unless you have coded logic in %ADDINIT to do otherwise). If you insert an 03 level here then all definitions below will NOT be part of TWA-DB-DATA and will NOT be initialized.
-
You may define areas here which are NOT read into; one common reason to do so would be to define Data Items which are to be COMPUTED or otherwise derived in the Logical Join process. This allows Logically Joining of non-database data.
Cautions:
-
Be careful not to use Cobol level 02 or 01 here. Also, the Cobol VALUE clause is illegal here.
-
This area is NOT initialized in BA100-INIT-STORAGE unless you code customization in %INIT and %LOCINIT to do so.
-
This area is within the 12K portion of the TWA which is saved and restored to the TWA-file. Defining a very large area here will possibly "push" other data beyond the 12K boundary, causing it NOT to be saved and restored. In that case you could move some of the areas defined here down to the %VARSTOR insertion point since this data usually does not need to be saved.
-
It is usually important that everything down to, not including, VARIABLE-STORAGE be within the 12K boundary.
Online Insertion Point
%DELEDIT
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB400-EDIT-FOR-DELETE
Description:
-
The logic in %DELEDIT will be inserted after the paragraph BB400-EDIT-FOR-DELETE and before the paragraph BB499-EXIT. It will make up the entire edit-for-delete routine.
-
Since there is no default logic for %DELEDIT, unless you provide a %DELEDIT routine the edit-for-delete will effectively be "null".
-
This logic will be performed before doing the delete in the xxxDEL function. If you set FATAL-ERR = E here, the delete will not be done, an error message will be issued instead.
-
Logic will be executed only in CONTINUATION-MODE for DEL functions.
Suggested Uses:
-
You might want to read other files to check for the existence of subordinate or related records before allowing the deletion to occur. For example, be sure there are no invoices on file for a customer before deleting the customer master record.
-
You might want to be sure that certain values in the record to be deleted are zero before allowing a deletion. For example, customer balance.
-
To set the ERROR-FOUND condition with an error message you can MOVE an error number to ERROR-NUMBER and then PERFORM CA100-LOAD-ERR-CODE-TBL THRU CA199-EXIT.
-
You might want to require that some PF key be used to do a delete. You could test:
IF (NOT TWA-MSK-PFx-HIT) ..
. and set an error condition.
Cautions:
-
Do not corrupt the TWA-DB-REQ-SAV area; that is where the TWA-DB-REQUEST area has been automatically saved just prior to executing the edit-for-delete routine.
-
If you are requiring some PF key to allow a delete, you should inform the operator. You could do that easily by MOVE'ing a message TO ENTER-TO-DEL-MSG, overlaying the default message "Press ENTER to Delete" with something like "Press PFx to Delete". This should be done in the %REDKY insertion point, after the I/O module call and after the PERFORM of JA100-LOGICAL-JOIN.
-
Avoid using PF1, PF15, PF13 or other PF keys already being used by MAGEC or your MMP.
Online Insertion Point
%DELET
Found in Model:
Location:
-
PROCEDURE DIVISION -- AAM730-DELETE-FROM-DATABASE
Description:
-
This logic will be used to accomplish the actual delete of the Primary Data Class' record. The default logic will call to the MAGEC I/O module using the "DELET" command. This logic will be executed only for xxxDEL functions and only if the ERROR-FOUND condition is not set by the edit-for-delete coding (see %DELEDIT).
Suggested Uses:
-
You could override the default coding completely to do an I/O command directly, bypassing the MAGEC I/O module. It might even be for a DBMS not directly supported by MAGEC.
-
A Proforma routine is presented when you are adding new %DELET customization coding, it is very similar to the default logic. You might wish to simply add a few lines of coding to the Proforma; perhaps to update a control record before actually doing the delete.
Cautions:
-
Be sure not to clobber TWA-DB-REQUEST, or be sure to save it in TWA-DB-REQ-SAV and then restore it if you need to do any other I/O in your customization.
-
If you wish to exit from this routine, remember that you must GO TO AAM750-TEST-RETURN-CODE, which is where the delete logic normally exits to.
Online Insertion Point
%EDIT
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB500-SCREEN-EDIT
Description:
-
Logic to validate data in any screen fields and set error number(s) as appropriate. This will be executed on database updating functions (xxxADD, xxxCHG, xxxDUP). Virtually any type of editing and validation may be done here, including any type and amount of I/O.
-
If you set the ERROR-FOUND condition here, then the MMP will not do the database update. Instead, it will return to the MAGEC Control Program to have the error message(s) sent.
-
There is no default logic for %EDIT.
Suggested Uses:
-
You can do any type of screen data validation here. You can do any type of "cross-field" validations or those involving I/O.
-
Remember, the Automatic Editing can handle most of the mundane chores for you; such as date validation, numeric editing, and table lookups. You should take advantage of the Automatic Editing to its fullest -- then code any additional edits here, as %EDIT customization. You may refer to Data Items (fields) in the "before image" record(s) (except on xxxADD functions) to compare them to screen data, if you wish. This enables you to determine which items were changed by the operator, or to do crossfield edits using Data Items which were not displayed to the screen.
-
You can set either fatal error or warning messages. Fatal errors prevent any updating to the database, warnings do not. To set a fatal error condition you PERFORM CA100-LOAD-ERR-CODE-TBL THRU CA199-EXIT; to set a warning message you PERFORM CA400-LOAD-WARNING-TO-TBL THRU CA499-EXIT.
Cautions:
-
To exit the BB500-SCREEN-EDIT routine you must GO TO BB599-EXIT. This bypasses both the %EDIT and %EDIT2 coding.
-
The editing logic you insert in %EDIT is in addition to whatever Automatic Editing has already done, it is a possibility that some error conditions have already been flagged by Automatic Editing prior to the Cobol MMP even receiving control.
-
You should adhere to the convention of setting the ERROR-FOUND condition (by PERFORM'ing CA100-LOAD-ERR-CODE-TBL THRU CA199-EXIT) and setting the error number (by MOVE'ing it to ERROR-NUMBER) and indicating the screen field in error (by MOVE'ing E to S_____E) -- as is shown in the Proforma when you are adding %EDIT logic.
Online Insertion Point
%EDIT2
Found in Model:
Location:
-
PROCEDURE DIVISION -- BB500-SCREEN-EDIT
Description:
-
This logic is similar to the %EDIT logic, except that it is for edits which might be "costly" (in terms of I/O, usually). These edits are preceeded by a test for the ERROR-FOUND condition. If any errors have already been found, then the %EDIT2 logic simply bypasses further checks and GO's to BB599-EXIT.
-
The value of using %EDIT2 is that it avoids unnecessarily consuming system resources by ceasing to look for more errors once a fatal error is detected.
-
This logic will be after BB500-SCREEN-EDIT and before BB599-EXIT. There is no default logic for %EDIT2.
Suggested Uses:
-
Any edits which involve heavy I/O burden. Any edits which would be illogical to do after other errors have been found.
-
It is permissible to update a file(s) here based on the fact that errors were (or were not) found above. This might be useful for gathering statistics regarding error rates, etc.
-
You need not worry about saving and restoring TWA-DB-REQUEST since the MMP's mainline logic saves it before PERFORM'ing BB500-SCREEN-EDIT THRU BB599-EXIT.
-
Editing and validation routines should adhere to the same conventions here as in %EDIT regarding setting the error number and setting the ERROR-FOUND condition, etc.
Cautions:
-
The %EDIT2 insertion point should be used instead of %EDIT only for those edits which will indeed be very costly to do unnecessarily. The disadvantage is that the operator may correct all the errors shown on the screen and then press ENTER only to be shown another error which was not detected earlier.
-
The normal logic, unless you have overridden it, will test for ERROR-FOUND in order to bypass further editing once an error is detected. You must be aware of this when planning the sequence of your edits. The first one to detect an error will bypass all following edits. For instance, you might wish to test for the most likely errors first.
-
Remember, all the %EDIT logic will be inserted before the %EDIT2 logic.
-
You should review the discussion for the %EDIT insertion point as well as this one.
Online Insertion Point
%FUNCT
Found in Model:
Location:
-
LINKAGE-SECTION -- VARIABLE-STORAGE
Description:
-
These are the "88-level" definitions of the various function codes for this MMP. They are inserted immediately following the 6-byte field named TEST-FUNCT. The logic of the MMP is very heavily controlled by these definitions.
-
This defines which functions are valid for this MMP, which are "Maintenance functions" and which are "Browse functions", and which are ADD, CHG, etc. These 88-level condition names are refered to throughout the MMP.
-
Default coding defines the standard nine functions, xxxADD, xxxCHG, xxxDEL, xxxSEE, xxxNXT, xxxDUP, xxxSCN, xxxFND, and xxxLOC.
Suggested Uses:
-
You can add your own custom functions to an MMP. Any six-character code which can be keyed into a 3270 screen will be valid, so long as it does not contain any blanks and it is not already defined for another MMP.
-
You might want two similar inquiry displays for different departments, one showing all the data and one showing only "non-sensitive" fields (or records). An easy and efficient way to do that would be to allow the xxxSEE function to show all data and define a new function (perhaps xxxINQ) which has different security requirements and uses the same screen and MMP, but "hides" the sensitive data by setting non-display 3270 attributes for them. You could set the attributes in %INITATB based on which function was being done.
-
You could also defeat a function that you absolutely do not want (such as the xxxDEL function) by setting the value of DEL-FUNCTION to blanks from 'DEL' (for instance).
Cautions:
-
All the standard 88-level condition names must be present in order for the MMP to compile clean. You may add some more of your own, but do not delete the standard ones.
-
The Automatic Editing routine in MAGEC's Control Program looks at the function codes to determine whether or not to do the editing. Essentially, it assumes that xxxADD, xxxCHG, and xxxDUP functions will update the database and thus should receive Automatic Editing. Other functions are assumed to NOT require Automatic Editing unless you have specifically told MAGEC that they do (on the FCDxxx screen). If you want to add a new updating function (similar to xxxCHG) which might be xxxUPD (for example), you will need to specify Auto Editing on the FCD definition (when you do FCDADD) as well as specifying it as another CHG-FUNCTION here in %FUNCT.
Online Insertion Point
%GOBACK
Found in Model:
Location:
-
PROCEDURE DIVISION -- AA900-GOBACK
Description:
-
Absolutely the last opportunity to insert code in the logical flow of the online processes for all functions, both MAINT-FUNCTIONS and BROWS-FUNCTIONS.
Suggested Uses:
-
This may be a good place to insert the TERMINATE for a PCB if you are using IMS
Cautions:
-
This is the logical end of the processing for all functions. If you desire to reference screen data you should first interrogate which mask is initialized.
Online Insertion Point
%GOODADD
Found in Model:
Location:
-
PROCEDURE DIVISION -- AAM753-GOODADD
Description:
-
This logic will be executed only on the xxxADD function after the return code has been checked to ensure that the I/O for an "add" completed successfully. If the add did not complete successfully then the %UPDERR logic will be executed instead of this logic.
-
The default logic for %GOODADD merely moves the DATA ADDED message to SCOMPL and fetches to the SEE function to re-display the added data.
Suggested Uses:
-
You may wish to issue a different message from the standard DATA ADDED message. You may wish to automatically transfer to another screen and function after a successful add. You would use the FTH-FUNCT command to do that. For example, after a successful CUSADD (Customer add) you might want the Invoice add (IVCADD) screen to immediately appear. You could do that by coding:
MOVE 'IVCADD' TO SFUNCT.
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST.
GO TO AA900-GOBACK.
-
You may wish to update some other files after a successful add, perhaps a control record or a transaction log file.
Cautions:
-
Remember, this logic is executed only if the "Primary" add was successful.
-
Depending on the Access Method, you may or may not be able to re-read the record just added using the RDUID command. RDUKY should work for any Access Method, however.
-
This logic should end with GO TO AA800-SEND-SCREEN (or optionally, GO TO AA900-GOBACK) to avoid falling thru irrelevant logic below.
Online Insertion Point
%GOODCHG
Found in Model:
Location:
-
PROCEDURE DIVISION -- AAM755-GOODCHG
Description:
-
This logic will be executed only on a xxxCHG function and only after a successful database update to the Primary Data Class. If the return code from the I/O indicates an error then the %UPDERR logic will be executed instead.
-
The default logic simply MOVE's the UPDATED-MSG to the screen field, SCOMPL, then fetches to the SEE function to re-display the updated data.
Suggested Uses:
-
You may want to update another record/file after a successful update of the Primary Data Class, perhaps some of the files which were Logically Joined in the %JOIN routines.
-
The Primary Data Class' data is still available to you in the TWA-DB-DATA area, you may reference it.
-
This would be a good place to "post" to a control record.
-
You might wish to transfer to another screen, function, or program after a successful update. You can do so by coding:
MOVE 'xxxxxx' TO SFUNCT.
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST.
GO TO AA900-GOBACK.
-
where xxxxxx is the desired "next function" you wish to transfer to.
-
An example of this might be a case where, after an update to an Invoice on the Invoice file (function IVCCHG, perhaps), you wish to transfer immediately to the Customer display screen to show the effect on the Customer's status. Assume that the function code is CUSSEE, and that the Customer number from the Invoice record is to be used as a key to read the Customer file with.
-
In the IVCCHG program (MMP), in the insertion point %GOODCHG, you could code:
MOVE 'CUSSEE' TO SFUNCT.
MOVE FTH-FUNCT TO TO TWA-NONTP-REQUEST.
MOVE IVC01-CUSTOMER-NO TO SKEY.
GO TO AA900-GOBACK.
Cautions:
-
To exit this routine be sure you GO TO AA800-SEND-SCREEN or to AA900-GOBACK to avoid falling through to the irrelevant logic below.
Online Insertion Point
%GOODDEL
Found in Model:
Location:
-
PROCEDURE DIVISION -- AAM757-GOODDEL
Description:
-
This logic will be executed only in xxxDEL functions and only after a successful delete of the Primary Data. If a bad return code is sensed (the delete failed) then the %UPDERR logic will be executed instead.
-
The default logic simply MOVE's the DELETED-MSG to the screen field, SCOMPL.
Suggested Uses:
-
You may want to update a control record, or any other file, after a successful delete.
-
You may want to transfer to another function, screen, or program. For example, after the deletion of an Invoice from the Invoice file you might want to automatically present the Customer display (function CUSSEE, perhaps) to show the effect on the Customer's status. To do that you might code:
MOVE 'CUSSEE' TO SFUNCT.
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST.
MOVE ------- TO SKEY. (customer number)
GO TO AA900-GOBACK.
Cautions:
-
To exit this routine you should GO TO AA800-SEND-SCREEN or AA900-GOBACK to avoid falling through to the irrelevant coding below.
Online Insertion Point
%INIT
Found in Model:
Location:
-
PROCEDURE DIVISION BA150-MAINT-INIT
Description:
-
This logic is executed in the initialization for all MAINT-FUNCTIONs (xxxADD, xxxCHG, xxxSEE, etc.) very early in execution of the program. VARIABLE-STORAGE is always set to LOW-VALUES just before the %INIT code is executed.
Suggested Uses:
-
You can initialize any data and work fields in VARIABLE-STORAGE (or elsewhere) here. This is useful when you have defined some of your own custom variables in %VARSTOR or in %DATADEF, particularly if they are COMP-3 and need to be set to ZERO to avoid Data Exception errors. In some environments it is permissible to MOVE to WORKING-STORAGE items also. Be careful of doing this in any environment in which your program might be "swapped" in and out, such as WESTI. It is best to reserve WORKING-STORAGE for constants, that is why the insertion point in WORKING-STORAGE is named %LITERAL.
Cautions:
-
Do not reference any screen fields except for the standard MAGEC fields (SFUNCT, SKEY, SCOMPL, and SERRMSG) here since this logic is executed before the MMP has made sure that the proper Mask format is in effect; it is possible that the screen is still formatted with some other MMP's Mask.
-
If you wish to check whether the Mask area is properly formatted, you may do so by coding:
IF TWA-MSK-ID = THIS-PGMS-MSK THEN .........
Online Insertion Point
%INITATB
Found in Model:
Location:
-
PROCEDURE DIVISION -- BA200-INIT-ATTRIBUTES