1.
Edit and Normalize the key value. If error found issue the INVALID KEY message and exit.
2.
Read file using Normalized key. If NOT-FOUND, issue NOT FOUND message and Blank screen with Underscores and exit.
3.
Save the Audit Stamp (if there is one).
4.
Fill the screen with data from the record.
5.
Issue PRESS ENTER TO DELETE message.
6.
Exit.
##
DEL Function, Continuation
1.
Edit and Normalize the key value. If error found issue the INVALID KEY message and exit.
2.
Read the record for update. If NOT-FOUND, issue NOT FOUND message and exit.
3.
Compare Audit Stamp to Saved Audit Stamp (if this Data Class has an Audit Stamp). If altered, issue UPDATED BY ANOTHER TASK message and exit.
4.
Edit for circumstances which would preclude deletion. If found, set FATAL-ERR and ERROR NUMBER and exit. This allows (cont.)
you to protect the Referential Integrity of your database when "parent" records are to be deleted by ensuring that no (cont.)
"children" will be left on file without a parent.
5.
Delete the file record.
6.
If delete was successsful, issue DATA DELETED message, otherwise issue the DB ERROR message.
7.
Exit.
##
SEE Function, New Transaction
1.
Edit and Normalize the key value. If error found issue the INVALID KEY message and exit.
2.
Read file using Normalized key. If NOT-FOUND issue NOT FOUND message and Blank screen with Underscores and exit.
3.
Save the Audit Stamp (if there is one).
4.
Fill the screen with data from the record.
5.
Exit.
##
SEE Function, Continuation
There is no Continuation Mode for a SEE Function; however, since the New Transaction Mode for a SEE Function is (cont.)
identical to the New Transaction Mode for CHG and DEL, the SEE Function can serve as the first phase for them. If the (cont.)
Operator changes the suffix of the Function Code from SEE to CHG or DEL then the MMP will go into Continuation Mode for (cont.)
the Change or Delete. This is true only if the Operator does not alter the Key Value. If the Key value is changed then (cont.)
the MMP will go into New Transaction Mode for the Change or Delete Function.
The DUP Function has no New Transaction Mode. The SEE Function serves as the New Transaction Mode for the DUP. If the (cont.)
Operator alters the Function Code suffix from SEE to DUP and also *does* alter the Key Value then the MMP will go into (cont.)
Continuation Mode for the DUP Function.
The NXT Function has no New Transaction Mode either. The SEE Function also serves as its New Transaction Mode. If the (cont.)
Operator alters the Function Code suffix from SEE to NXT and *does not* change the key value, the MMP will go into the (cont.)
Continuation Mode for the NXT Function. If the key value is altered, the PRIOR FUNCTION WAS NOT A SEE message will be (cont.)
issued.
##
NXT Function, New Transaction
There is no New Transaction Mode for a NXT Function. The SEE Function serves as its New Transaction Mode. The NXT (cont.)
Function must be preceeded by a successful SEE (not NOT-FOUND). The Operator must alter the Function Code suffix from (cont.)
SEE to NXT and *not alter* the key value. The MMP will then go into the Continuation Mode for the NXT Function. (cont.)
Pressing PF8 (page forward) or PF7 (page backward) automatically changes the Function Code suffix to (cont.)
NXT.
##
NXT Function, Continuation
1.
Restore the MAGECIO Request Area from the saved area so that it is the same as after the last READ was done.
2.
Set the MAGECIO command to REDNX (read next) and issue the MAGECIO Request.
3.
If NOT FOUND (end of data), move END OF DATA message and "Blank" the screen with Underscores and exit.
4.
Fill in the screen with data from the record.
5.
Save MAGECIO Request Area.
6.
Exit.
##
DUP Function, New Transaction
There is no New Transaction Mode for the DUP Function, the SEE Function serves as its New Transaction phase. The (cont.)
Operator first must do a SEE Function and must have successfully found an item (not NOT-FOUND). Then the Operator (cont.)
changes the Function Code to the DUP Function by altering the last three characters to "DUP" and also alters the key (cont.)
value to the desired new key to be added. He/She may also alter any displayed data on the screen at the same time. Then (cont.)
He/She presses ENTER, the resulting transaction will be a DUP Function in Continuation mode.
##
DUP Function, Continuation
1.
Internally alter the Function Code suffix to ADD.
2.
Process the transaction as an ADD Function, Continuation Mode.
##
LOC Function, New Transaction
1.
Set NUMBER-OF-RECORDS to 16.
2.
Normalize the entered key value and set the key name in the MAGECIO Request Area.
3.
Position generically (LOCKY) using the Normalized key value.
4.
If NOT-FOUND (end of data), move END OF DATA message to SCOMPL and to screen body and exit.
5.
Read first record (REDLE). If NOT-FOUND, set DB ERROR message and exit, otherwise go to Step 7 below.
6.
Read next record (REDNX), if NOT-FOUND, move END OF DATA message to SCOMPL and exit.
7.
Build a display line from record data and move into screen.
8.
If screen is full (determined by NUMBER-OF-RECORDS), move PF KEY DIRECTIONS message into SCOMPL and exit.
9.
Go back to Step 6 above.
##
LOC Function, Continuation
1.
Set NUMBER-OF-RECORDS to 16.
2.
Continue processing starting at Step 6 for New Transaction Mode above.
##
SCN Function, New Transaction
1.
Set NUMBER-OF-RECORDS to 16.
2.
If Character Mask is "virgin", issue ENTER SELECTION MASK message and force the next transaction to also be a New Transaction Mode, exit.
3.
Normalize the entered key value and set the key name in the MAGECIO Request Area.
4.
Position generically (LOCKY) using the Normalized key value.
5.
If NOT-FOUND (end of data), move END OF DATA message to SCOMPL and to screen body and exit.
6.
Read first record (REDLE). If NOT-FOUND, set DB ERROR message and exit, otherwise go to Step 9 below.
7.
If number of reads has reached the SCAN-LIMIT, simulate that the screen is full and go to Step 11 below.
8.
Read next record (REDNX), if NOT-FOUND, move END OF DATA message to SCOMPL and exit.
9.
Build display line from record data and compare to Selection Mask, if not a "hit", go to Step 7 above.
10.
Move the display line into the screen.
11.
If screen is full (determined by NUMBER-OF-RECORDS), move PF KEY DIRECTIONS message into SCOMPL and exit.
12.
Go back to Step 7 above.
##
SCN Function, Continuation
1.
Set NUMBER-OF-RECORDS to 16.
2.
Continue processing at Step 7 above in New Transaction Mode.
##
FND Function, New Transaction
1.
Set NUMBER-OF-RECORDS to 16.
2.
If Search Argument is null, issue ENTER SEARCH ARGUMENT message and force the next transaction to also be a New Transaction Mode, exit.
3.
Normalize the entered key value and set the key name in the MAGECIO Request Area.
4.
Position into the file generically (LOCKY) using the Normalized key value.
5.
If NOT-FOUND (end of data), move END OF DATA message to SCOMPL and to screen body and exit.
6.
Read first record (REDLE). If NOT-FOUND, set DB ERROR message and exit, otherwise go to Step 9 below.
7.
If number of reads has reached SCAN-LIMIT, simulate that the screen is full and go to Step 11 below.
8.
Read next record (REDNX). If NOT-FOUND, move END OF DATA message to SCOMPL and exit.
9.
Build display line from record data and compare to Search Argument(s), if not a "hit", go to Step 7 above.
10.
Move the display line into the screen.
11.
If screen is full (determined by NUMBER-OF-RECORDS), move PF KEY DIRECTIONS into SCOMPL and exit.
12.
Go back to Step 7 above.
##
FND Function, Continuation
1.
Set NUMBER-OF-RECORDS to 16.
2.
Continue processing at Step 7 above in New Transaction Mode.
#
Operating Environment
##
MAGEC Control Program
The MMP operates as a subordinate program to the MAGEC Control Program. Whenever an Operator makes an entry and presses (cont.)
a transmit key to send the message to the CPU, the message is passed to the MAGEC Control Program (MAGECCP). MAGECCP (cont.)
accepts the incoming message and formats it into the TWA-MSK-AREA where the Mask Copybook defines (cont.)
it.
MAGECCP performs the Automatic Edits and Security Validation and then passes control to the Cobol MMP -- if the (cont.)
Operator is properly authorized. The MMP receives the message in the standard MAGEC Masking format and does not concern (cont.)
itself with the mechanics of reading and writing to the terminal or handling the variable incoming and outgoing (cont.)
formats. The MMP is actually portable, it can be executed in any MAGEC-supported environment. That includes MVS/CICS, (cont.)
VSE/CICS, Westi, VM/CMS (with or without VM-CICS), and PC and PS/2 environments using MS-DOS, PC-DOS, or OS/2, and (cont.)
LAN's.
SInce all interface with the environmnet is handled by the MAGECCP program, the individual MMP's need not be aware of (cont.)
the specifics of that environment. This enables the same MMP to operate in any supported enviroment with no program (cont.)
changes. On a network the same MMP can be executed in character mode and in GUI (Graphical User Interface) mode (cont.)
simultaneously. That is because the screen formatting and decoding is done externally to the MMP (cont.)
itself.
After receiving the formatted, edited, incoming message, the MMP does its processing. When it is ready to send the message back to the Operator it just exits, returning control back to MAGECCP.

next: genmmp03.md.txt