MAGECCP checks whether the FATAL-ERR flag has been set indicating that errors were detected by either the Automatic (cont.)
Editing or by the Business Rule processing, or by the MMP's Custom editing. It sets the appropriate Error Messages (cont.)
(from the ERR file) into the screen area if so. It then performs a compression routine to optimize the message (cont.)
transmission and reformat it into the proper outgoing 3270, or other, format and then sends it to the Operator's (cont.)
terminal.
The work of the MMP is greatly simplified because it is relieved of the burdens of handling terminal message (cont.)
peculiarities and because all the needed resources are gathered together and passed to it in the TWA area. If the (cont.)
Operator is not authorized to do the Function he/she is attempting, then the MMP does not even receive control, a (cont.)
Security Violation message is sent to the Operator instead.
#
Program Code
##
ID Division
| ```
**
ID DIVISION.
PROGRAM-ID. MMP600.
*** VAC FILE MAINTENANCE AND BROWSE.
AUTHOR. YOUR.NAME
INSTALLATION. MAGEC.GENERATED.MMP
DATE-COMPILED. 01/01/95-13:00:08.
*REMARKS.
*************************************************
* THIS MMP GENERATED BY *
* MAGEC MMPCRE - A PROPRIETARY PRODUCT *
* OF AL LEE & ASSOCIATES, INC. *
* (214) 202-4965 *
* THIS PROGRAM WAS CREATED, USING SHD *
* NUMBER (MSK) 600,ON 06/01/25 AT *
* 13:00:08 TO USE THE CICS MONITOR.*
* "COPY BOOKS" ARE TO BE EXPANDED *
* FROM THE MAGEC LIBRARY WHEN COMPILED.*
* *
* *
* - - - GENERATED USING 'MODELMMP' - - - *
* IT PROVIDES UPDATE AND DISPLAY FUNCTIONS *
* AND BROWSES THE DATA CLASS VAC *
* *
* IT WILL PRODUCE A HARDCOPY OF THE SCREEN *
* OR BROWSE LIST IF THE OPERATOR PRESSES *
* THE PF13 KEY. *
* *
* *
* BROWSES MAY BE DONE IN SEQUENCE BY: *
* VACK1 - Employee# (9-digits) *
* * * DEFAULT ALGORITHM %REMARKS STARTS HERE
* * * DEFAULT ALGORITHM %REMARKS ENDS HERE
*************************************************
```**
The Identification Division of the generated MMP is largely remarks. It gives an audit trail of what parameters were (cont.)
used into the MMPCREAT Job Stream and when the MMP was generated and Compiled. The insertion point %REMARKS is where (cont.)
you may insert your own comments to be generated into the MMP.
##
Environment Division
| ```
**
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
****************************************************************
* *
* NO ADDITIONAL CODING IS DONE IN THIS DIVISION FOR MMP'S *
* *
****************************************************************
```**
The Environment Division contains no coding for online MMP's and you may not add any coding of your own since there is no insertion point provided.
##
Working Storage
| ```
**
DATA DIVISION.
* * * DEFAULT ALGORITHM %SCHEMA STARTS HERE
* * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * *
* * * DEFAULT ALGORITHM %SCHEMA ENDS HERE
WORKING-STORAGE SECTION.
SKIP2
01 CORE-MARK.
SKIP2
****************************************************************
* *
* THIS AREA IS GENERATED TO PROVIDE AN ID FOR EASIER *
* LOCATION IN CORE DUMPS AND TO PROVIDE CONSTANTS FOR *
* MMP, MSK, AND ELEMENT NAMES AND THE MASTER-KEY NAME. *
* *
****************************************************************
SKIP2
03 MMP-LIT PIC XXX VALUE 'MMP'.
03 THIS-MMP PIC XXX VALUE '600'.
03 DATE-TIME-GENERATED PIC X(18) VALUE '06/01/25-13:00:08'.
03 FILLER REDEFINES DATE-TIME-GENERATED.
05 DATE-GENERATED PIC X(9).
05 TIME-GENERATED PIC X(9).
03 MSK-CMD PIC XXX VALUE 'MSK'.
03 THIS-PGMS-MSK PIC XXX VALUE '600'.
03 COMMON-LOC-MSK PIC XXX VALUE '652'.
03 COMMON-POP-MSK PIC XXX VALUE '6PU'.
03 FILLER PIC X(32) VALUE
'VAC MAINT/LOCAT'.
03 MASTER-KEY-NAME PIC X(5) VALUE 'VACK1'.
03 FILLER REDEFINES MASTER-KEY-NAME.
05 FILLER PIC X(4).
05 MASTER-KEY-NO PIC X.
03 THIS-PGMS-ELEMENTS.
05 ELT-01 PIC X(6) VALUE 'VAC01 '.
05 FILLER PIC X(6) VALUE ' '.
* * * BELOW IS FOR SPOOLER
01 SPOOL-ERR-MSG.
03 FILLER PIC X(06) VALUE 'ERROR '.
03 SPOOL-ERR-COD PIC X VALUE SPACE.
03 FILLER PIC X(20) VALUE
' FROM SPOOL-SUB ON '.
03 SPOOL-ERR-CMD PIC X(05) VALUE SPACE.
03 FILLER PIC X(12) VALUE ' FOR REPORT '.
03 SPOOL-ERR-RPT PIC X(4) VALUE SPACE.
SKIP1
01 WS-TEST-REPORT-MSG.
03 FILLER PIC X(18) VALUE
'&& REPORT NUMBER'.
03 WTR-REPORT-NO PIC X(4) VALUE SPACE.
03 FILLER PIC X(20) VALUE
' GENERATED &&'.
SKIP2
01 PF-KEY-INSTRUCTIONS.
03 FILLER PIC X(40) VALUE SPACE.
03 FILLER PIC X(40) VALUE
* 'Press PF13 for Hardcopy'.
03 FILLER PIC X(40) VALUE
* ' You may Position the CURSOR on an item '.
03 FILLER PIC X(40) VALUE
* 'and Press ENTER to "SEE" it'.
03 PFK-BROWSE-DIR PIC X(40) VALUE SPACE.
03 FILLER PIC X(40) VALUE
* 'or Press PF4 to "CHG" it'.
```**
The Working Storage section is used to contain literal constants only. The MMP never alters the data in Working (cont.)
Storage. Any fields which are used as work areas or as the target fields for MOVE's or COMPUTE's must be in the TWA in (cont.)
the Linkage Section. The exception to this rule is those cases in which the program will MOVE to a field in Working (cont.)
Storage and will then access it without ever exiting (to do an I/O, for example) in between. In a fully reentrant (cont.)
environment (see explanation below). the program should assume that Working Storage will be re-initialized when the (cont.)
program receives control back after having exited. If you have trouble understanding this concept, play it safe. Don't (cont.)
MOVE to Working Storage fields.
**Reentrancy
**
There are three(3) classes of programs in CICS (or any interactive transaction environment). First, there are (cont.)
'non-reusable' programs. This class must be loaded fresh from the loadlibrary for every transaction--not very efficient (cont.)
for high-volume tasks. Second there are 'serially-reusable' programs. They can be reused for multiple transactions, for (cont.)
multiple users, but only one at a time. Third, there are 'reentrant' programs. These programs can be used by multiple (cont.)
transactions, for multiple users, without being reloaded from the loadlibrary and with a single copy loaded in memory. (cont.)
This is obviously the most efficient class of programs.
MAGEC MMP`s are generated to the standard for full reentrancy. To be reentrant, the program must NEVER modify any (cont.)
portion of itself so that it is always identical. If may only modify memory that is NOT a part of its code, such as (cont.)
fields in the Linkage Section. Please keep in mind that this means not only that the program must be identical each (cont.)
time it is entered at the top of the PROCEDURE DIVISION , but also whenever it is returned to after a link to a (cont.)
subroutine or an I/O event.**
| ```
* * * * * * * * * * * * * * * * * * * * * * * * * *
* THE FOLLOWING IS THE HEADING TO BE DISPLAYED *
* ON THE 'TOP' LINE OF THE SCREEN... *
* * * * * * * * * * * * * * * * * * * * * * * * * *
01 HDG-LINE PIC X(80) VALUE
* 'Emp# First Name Last Name Hire D
* - 'ate Earned Vacation'.
SKIP2
01 KEY-NO-EDIT-PARMS.
03 FILLER PIC X(26) VALUE '10902N0900A '.
03 END-OF-KEY-PARMS.
05 FILLER PIC X VALUE HIGH-VALUES.
05 FILLER PIC X(25) VALUE ALL '0000A'.
01 FILLER REDEFINES KEY-NO-EDIT-PARMS.
03 KEY-NO-EDIT-PARM OCCURS 2 TIMES.
05 KEY-NO PIC X.
05 KEY-PARMS PIC X(25).
01 FILLER REDEFINES KEY-NO-EDIT-PARMS.
03 FILLER PIC X.
03 KEY-LITERAL OCCURS 5 TIMES.
05 KEY-MAX-LGTH PIC S99.
05 KEY-MIN-LGTH PIC S99.
05 KEY-TYPE PIC X.
```**
The Heading Line is to be used on the Browse screens (LOC, SCN, and FND). It contains the Locate Heading literal (cont.)
provided by the Developer using the SCDLST, SCDCHG Functions online. If the Developer did not give any Locate Headings (cont.)
then MMPCREAT would have generated its own from the Cobol data names of the fields being displayed (with the standard (cont.)
Element-Name prefix stripped off).
The Key Editing Parms were generated from the definition for the key (VACK1) on the KYF file. They control the logic (cont.)
and processing of the Normalize-Key routines which edit and reformat the entered key into proper format to read the (cont.)
file with.
##
Short List
| ```
**
01 WS-SHORT-LIST-PAGE-MSG
* 03 FILLER PIC X(3) VALUE '(# '.
03 WS-SL-THIS-ITEM PIC 99 VALUE ZERO.
* 03 FILLER PIC X(4) VALUE ' of '.
03 WS-SL-LAST-ITEM PIC 99 VALUE ZERO.
* 03 FILLER PIC X(3) VALUE ' of'.
03 WS-SHORT-LIST-HDG.
05 FILLER PIC X(17) VALUE
* ' Short List from '.

next: genmmp04.md.txt