AAP753-TRUNCATE.
MOVE VERTICAL-BAR TO SLW-BYTE (1).
MOVE LOW-VALUE TO SLW-BYTE (SLW-SUB).
IF SLW-SUB LESS THAN SEVENTY-EIGHT
ADD ONE TO SLW-SUB
GO TO AAP753-TRUNCATE.
MOVE SLINE-WORK TO MSK6PU-SLINE (SCW-SUB).
GO TO AAP752-NEXT-STOPPER.
AAP755-CONT.
MOVE SCREEN-CONSTANT-WORK TO MSK6PU-SCREEN-CONSTANTS.
MOVE LOW-VALUES TO END-SEW.
MOVE SCREEN-EDIT-WORK TO TWA-MSK-EDIT-WORDS.
COMPUTE TWA-MSK-CUR-AD-IN =
MSK6PU-SLINE-POSN (TWA-MSK-CUR-AD-OT).
MOVE TWA-MSK-CUR-AD-IN TO TWA-MSK-CUR-AD-OT.
MOVE MSK6PU-SFUNCT TO TWA-LAST-FUNCT.
MOVE MSK6PU-SKEY TO TWA-LAST-KEY.
GO TO AA800-SEND-SCREEN.
AA760-ATTACH.
MOVE TWA-MSK-CUR-AD-IN TO TWA-MSK-CUR-AD-OT.
MOVE SCOMPL TO VS-ATT-SCOMPL-SV.
MOVE SERRMSG TO VS-ATT-SERRMSG-SV.
MOVE HIGH-VALUE TO TWA-MSK-AID.
MOVE ATT-FUNCT TO TWA-NONTP-REQUEST.
GO TO AA900-GOBACK.
AA770-DETACH.
MOVE LOW-VALUE TO TWA-MSK-AID.
MOVE DET-FUNCT TO TWA-NONTP-REQUEST.
GO TO AA900-GOBACK.
AA780-ESCAPE-TO-MENU.
MOVE QUOTE TO TWA-MSK-AID.
MOVE TWA-LAP TO WS-EPF3-LAP
MOVE SFUNCT TO WS-EPF3-PREFIX.
MOVE WS-ESC-PF3-SKEY TO SKEY.
MOVE WS-ESC-PF3-SFUNCT TO SFUNCT.
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST.
GO TO AA900-GOBACK.
```**
The above logic produces the Short List pop-up window. The Short List is a list of record ID's which is saved when the (cont.)
operator does a LOC, SCN, or FND function. The Short List contains the ID's of the items which were displayed on the (cont.)
screen. In the case of a SCN or FND function that means that the Short List is a list of those items which matched the (cont.)
search criteria.
The logic in the AAP100 routine is invoked when the operator presses PF24 while in a MAINT function. That means that (cont.)
he/she could have done a query and then cursor-selected an item and been transferred to the maintenance screen for that (cont.)
item. Then he/she can press PF24 and a pop-up window will display the Short List. He/She can cursor-select from the (cont.)
Short List pop-up display and be transferred to the maintenance display for the selected item, and so (cont.)
forth.
If you desired to add your own pop-up displays to a program you might study this routine and model yours after it. All (cont.)
pop-up displays can use the same screen mask (MSK6PU). You can set the position and width of the pop-up window and you (cont.)
can set the color of it.
You can control the color, position, and width of the pop-up window using the data fields: WINDOW-COLOR, TOP-LEFT-POSN, and WINDOW-WIDTH.
The AA760-ATTACH routine is branched to by the program logic when the program is to Attach down to the next level, as in going from a LOC function to a MAINT function.
The AA770-DETACH routine is branched to by the program logic when the program is to Detach back up to the next level, such as going from a MAINT function back to a LOC function.
The AA780 routine is used to exit back to the low-level menu from this application. It is normally branched to when the Operator presses the PF3 key.
##
Exit Routines
| ```
**
AA800-SEND-SCREEN.
IF TWA-MSK-ID = COMMON-POP-MSK
GO TO AA900-GOBACK.
IF (MAINT-FUNCTION) AND (TWA-SERRMSG-MSG (6) EQUAL SPACES)
PERFORM FA600-TST-SHORT-LIST-SRC THRU FA699-EXIT
IF (SHORT-LIST-AVAIL)
MOVE WS-SHORT-LIST-INSTR TO TWA-SERRMSG-MSG (6).
IF ((TWA-SWAP-ATTACHED) AND
(TWA-SERRMSG-MSG (6) EQUAL SPACES))
MOVE WS-DETACH-MSG TO TWA-SERRMSG-MSG (6).
IF SKEYE = E
MOVE SPACES TO TWA-LAST-KEY.
IF SCOMPLE = E
MOVE SPACES TO TWA-LAST-KEY
IF (MAINT-FUNCTION)
PERFORM BB100-BLANK-SCREEN THRU BB199-EXIT.
* * * DEFAULT ALGORITHM %SNDSCRN STARTS HERE
* * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT
* * * DEFAULT ALGORITHM %SNDSCRN ENDS HERE
GO TO AA900-GOBACK.
AA800-CALL-MONITOR.
MOVE REDKY TO TWA-DB-CMD
MOVE MSK-CMD TO TWA-DB-FILE-NAME
MOVE 'MSKK1' TO TWA-DB-KEY-NAME
MOVE TWA-TP-TRM TO TWA-KEY-VALUE
MOVE 'MSK01 MSK02 MSK03 MSK04 ' TO TWA-ELT-LIST.
AA840-CALL-MAGEC-IO.
CALL 'SETIOMMP' USING TWA-MODE TWA-SUB-MMP-NUM.
AA850-SUB-CALL.
MOVE MMP-LIT TO TWA-SUB-LIT.
EXEC CICS LINK PROGRAM(TWA-SUB-MMP) END-EXEC.
AA899-EXIT.
EXIT.
AA900-GOBACK.
* * * DEFAULT ALGORITHM %GOBACK STARTS HERE
* * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * *
* * * DEFAULT ALGORITHM %GOBACK ENDS HERE
MOVE '3' TO TWA-BIG-INDICATOR
ELSE
MOVE '2' TO TWA-BIG-INDICATOR.
EXEC CICS RETURN END-EXEC.
```**
The AA800 and AA900 routines are the exit routines which are used to terminate processing for this MMP and return to the MAGEC Control Program to send the message or FTH-FUNCT another Function, etc.
The actual coding in this area will vary slightly from one TP Monitor to another, this example is for CICS. The (cont.)
differences are of no concern to you, though. When you perform AA840-CALL-MAGEC-IO or go to AA900-GOBACK you will get (cont.)
the same results regardless what environment you are operating in.
##
B-Level Subroutines
| ```
**
****************************************************************
* B-LEVEL SUBROUTINES *
* PERFORMED FROM AAL... AND AAM... MAINLINES *
****************************************************************
* BA100 INITIALIZE WORK AREAS IN VARIABLE-STOREAGE *
****************************************************************
BA100-INIT-STORAGE.
MOVE LOW-VALUES TO VARIABLE-STORAGE.
MOVE SKEY TO TEST-KEY.
MOVE SFUNCT TO TEST-FUNCT.
MOVE ZEERO TO LOC-ACCUM-1 LOC-ACCUM-2
LOC-ACCUM-3 LOC-ACCUM-4 LOC-ACCUM-5 LOC-ACCUM-6
LOC-ACCUM-7 LOC-ACCUM-8 LOC-ACCUM-9.
MOVE SPACES TO SCREEN-FIELD
PATTERN-ERROR
PATTERN-MASK
DE-EDITED-DATA.
CALL'MAGXFRM' USING EIGHTY HDG-LINE
ONE HIVALU APOSTROPHE.
MOVE ZEERO TO DE-EDITED-VALUE.
MOVE Y TO TRANSFORM-SW.
MOVE TWA-TIME TO VS-MARKER.
IF (BROWS-FUNCTION)
GO TO BA105-LOCAT-INIT
ELSE
GO TO BA150-MAINT-INIT.
BA105-LOCAT-INIT.
MOVE ALL '.' TO WS-ITEM.
MOVE SIXTEEN TO NUMBER-OF-RECORDS.
BA106-BLANK-FIL.
MOVE SPACES TO WS-FILL-01
WS-FILL-02
WS-FILL-03
WS-FILL-04
WS-FILL-05
WS-FILL-06
WS-FILL-07
WS-FILL-08
WS-FILL-09.
BA107-EXIT.
EXIT.
BA108-CONT.
MOVE WS-ITEM TO MSK-DOT-LINE.
MOVE SPACES TO WS-ITEM.
MOVE 'Emp# '
TO LOC-HDG (1)
MOVE 'Earned Vacation '
TO LOC-HDG (5)
CALL 'MAGXFRM' USING TWO-TWENTY-FIVE LOC-HDGS
ONE HIVALU APOSTROPHE.
MOVE Y TO UPPERCASE-SW.
IF TWA-MSK-ID EQUAL COMMON-LOC-MSK
AND
(TEST-FUNCT EQUAL TWA-LAST-FUNCT)
AND
(TWA-NR-LINES-SENT GREATER THAN ZEERO)
AND
(TEST-KEY EQUAL TWA-LAST-KEY)
THEN
COMPUTE WS-LINE-SELECTED EQUAL
(TWA-MSK-CUR-AD-IN / +80) - THREE.
IF WS-LINE-SELECTED GREATER THAN TWA-NR-LINES-SENT
OR
WS-LINE-SELECTED LESS THAN ONE
OR
(TWA-MSK-PF7-HIT) OR (TWA-MSK-PF8-HIT)
THEN
MOVE ZEERO TO WS-LINE-SELECTED.
* THE ABOVE ALLOWS THE LOCINIT AND PFKEYL LOGIC TO SENSE
* WHETHER A LINE WAS SELECTED.
* * * DEFAULT ALGORITHM %LOCINIT STARTS HERE
* * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT
* * * DEFAULT ALGORITHM %LOCINIT ENDS HERE
IF UPPERCASE-SW = Y
CALL 'UPCASE' USING SIXTY-SIX MSK652-SSEARCH.
CALL 'UPCASE' USING SEVENTY-NINE MSK652-SDOTMSK.
MOVE TWA-TIME TO VS-MARKER.
GO TO BA199-EXIT.
BA150-MAINT-INIT.
MOVE F TO TWA-BROWSE-DIRECTION.
* * * DEFAULT ALGORITHM %INIT STARTS HERE
* * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT
* * * DEFAULT ALGORITHM %INIT ENDS HERE
BA199-EXIT.
EXIT.
```**
This is the initialization routine which is always performed at the start of processing. Notice the insertion points (cont.)
%LOCINIT and %INIT. If you want to add some additional logic to the initialization for the Browse Functions you would (cont.)
use %LOCINIT, for the Maintenance Functions use %INIT. In this sample MMP there was no Customization for (cont.)
either.
| ```
**

next: genmmp19.md.txt