TO WS-SDATE-H-DD. MOVE SLASH TO WS-SDATE-H-SLASH-2. MOVE VAC01-DATE-HIRED-YY TO WS-SDATE-H-YY. MOVE VAC01-EARNED-VACATION TO WS-SEARNED. * * * DEFAULT ALGORITHM %LOCMOV STARTS HERE * * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * * DEFAULT ALGORITHM %LOCMOV ENDS HERE CALL 'MAGXFRM' USING ONE-HUNDRED-SIXTY WS-ITEM ONE LOVALU SPACE-CHAR. IF (FND-FUNCTION) PERFORM DA100-TEST-FND THRU DA199-EXIT ELSE IF (SCN-FUNCTION) PERFORM CA900-TEST-SCN THRU CA999-EXIT. IF (BYPASS-INDICATED) SUBTRACT ONE FROM LIN-CTR GO TO CA790-END. ADD ONE TO CUMULATIVE-DSPLY-CTR. IF (TWA-MSK-PF13-HIT) PERFORM CB900-SPOOL THRU CB999-EXIT IF (NOT SR-OK) MOVE E TO PROCESS-INDICATOR GO TO CA799-EXIT ELSE GO TO CA799-EXIT. PERFORM CA800-BUILD-SKEY THRU CA899-EXIT. IF TWA-MSK-ID = COMMON-LOC-MSK MOVE WS-ITEM TO MSK652-SLINE (LIN-CTR). CA790-END. IF (TWA-MSK-PF13-HIT) GO TO CA799-EXIT. MOVE CUMULATIVE-SCAN-CTR TO SLM-CTR. CALL 'MAGXFRM' USING SEVEN SLM-CTR-X ONE SPACE-CHAR LOVALU. MOVE CUMULATIVE-DSPLY-CTR TO SLM-DSP-CTR. CALL 'MAGXFRM' USING SEVEN SLM-DSP-CTR-X ONE SPACE-CHAR LOVALU. ADD ONE TO LIN-CTR. MOVE PAGE-CTR TO SLM-PAGE. IF TWA-MSK-ID = COMMON-LOC-MSK MOVE SCAN-LIMIT-MSG TO MSK652-SLINE-SHORT (LIN-CTR). SUBTRACT ONE FROM LIN-CTR. MOVE LIN-CTR TO TWA-NR-LINES-SENT. IF SCAN-CTR LESS THAN SCAN-LIMIT GO TO CA799-EXIT. MOVE LIN-CTR TO LIN-HI-SUB. MOVE NUMBER-OF-RECORDS TO LIN-CTR. CA799-EXIT. EXIT. ``` The CA700 routine is performed by the Browse Functions to build a display line from the record and determine whether it (cont.) should be shown or not. The moves generated here are to the WS-ITEM area in the TWA which will be moved to a screen (cont.) line in the Browse Mask (MSK652) if the PROCESS-INDICATOR contains the value P, see below. The insertion point %SELECT allows you to insert Customization code to inspect the record before it is processed and to (cont.) set the PROCESSINDICATOR to control the logic below. You can tell it to process this record (P), bypass it (B), or to (cont.) simulate that it is at end-of-file (E). If you have files with multiple record types of different format records this (cont.) insertion point will be invaluable to you, you can bypass the records which are in the wrong format. You might also (cont.) want to show only records for the Operator's Company or Department. The other insertion point you have in this routine is %LOCMOV. It allows you to add your own additional MOVE's or COMPUTE's to finish the building of the display line. For the SCN and FND Functions the checking for whether this item meets the selection criteria is done immediately behind the %LOCMOV insertion point. ``` * * * DEFAULT ALGORITHM %SKEYBLD STARTS HERE **************************************************************** * CA800 * * THIS ROUTINE MOVES THE KEY VALUE FROM THE RECORD TO * * SKEY WHEN IN THE NXT-FUNCTION DISPLAY LOGIC. * * * **************************************************************** CA800-BUILD-SKEY. MOVE VAC01-KEY TO NORMALIZED-KEY. PERFORM CA200-SERIAL-SEARCH VARYING KEY-SUB FROM ONE BY ONE UNTIL KEY-NO (KEY-SUB) EQUAL MASTER-KEY-NO OR HIVALU. IF KEY-NO (KEY-SUB) EQUAL HIVALU GO TO CA899-EXIT. MOVE NORMALIZED-KEY TO FILE-KEY. MOVE FILE-KEY1 TO NK-KEY1-N. MOVE FILE-KEY2 TO NK-KEY2-N. MOVE FILE-KEY3 TO NK-KEY3-N. MOVE FILE-KEY4 TO NK-KEY4-N. MOVE FILE-KEY5 TO NK-KEY5-N. MOVE NORM-KEY TO NORMALIZED-KEY. MOVE KEY-PARMS (KEY-SUB) TO KEY-PARM-X. MOVE SPACE TO TEST-KEY. MOVE ZEERO TO NK-SUB TK-SUB. MOVE SPACE TO TEST-KEY. PERFORM CA870-MOVER THRU CA879-EXIT VARYING NN-SUB FROM ONE BY ONE UNTIL NN-SUB GREATER THAN FIVE. PERFORM CA200-SERIAL-SEARCH VARYING TK-SUB FROM THIRTY-SIX BY MINUS-ONE UNTIL (TK-SUB LESS THAN TWO) OR (TK-BYTE (TK-SUB) NOT = D-LIMITER AND TK-BYTE (TK-SUB) NOT = SPACE). ADD ONE TO TK-SUB. PERFORM CA850-PAD-BLANKS THRU CA859-EXIT VARYING TK-SUB FROM TK-SUB BY ONE UNTIL TK-SUB GREATER THAN THIRTY-SIX. IF (BROWS-FUNCTION) MOVE TEST-KEY TO TWA-SV-KEY (LIN-CTR) ELSE PERFORM CA500-MOVE-SKEY THRU CA599-EXIT MOVE NORMALIZED-KEY TO SKEY TWA-LAST-KEY. GO TO CA899-EXIT. CA850-PAD-NKS. MOVE SPACE TO TK-BYTE (TK-SUB). CA859-EXIT. EXIT. CA870-MOVER. IF KP-MAX-LGTH (NN-SUB) NOT NUMERIC MOVE ZEERO TO KP-MAX-LGTH (NN-SUB). CA872-MOVER. IF TK-SUB NOT LESS THAN THIRTY-SIX GO TO CA879-EXIT. IF (KP-MAX-LGTH (NN-SUB) LESS THAN ONE) GO TO CA878-END. ADD ONE TO NK-SUB. ADD ONE TO TK-SUB. MOVE NK-BYTE (NK-SUB) TO TK-BYTE (TK-SUB).. SUBTRACT ONE FROM KP-MAX-LGTH (NN-SUB). GO TO CA872-MOVER. CA878-END. ADD ONE TO TK-SUB. MOVE D-LIMITER TO TK-BYTE (TK-SUB). CA879-EXIT. EXIT. CA899-EXIT. EXIT. * * * DEFAULT ALGORITHM %SKEYBLD ENDS HERE ``` The entire CA800 routine is a Default for the insertion point named %SKEYBLD. Its purpose is to build the key value in (cont.) screen format from the Master key field in the record. It is performed from the NXT Functions. In most cases you would (cont.) not want to touch this routine. In the unlikely event that you need to display the key somehow other than it would be (cont.) built by this routine then you can override the entire CA800 routine with your own. ## Service Routines The CA600, CA900, CB200, CB500, CB600, CB900, DA100, DA200, DA300, FA100, FA400, and FA500 routines are not shown here (cont.) because they are used "internally" by the SCN and FND Functions and by the Pattern Editing. You cannot alter them. The (cont.) CC100 routine, also not shown, is used for the VERZUN function which displays statistics for your application. The (cont.) DA400 routine (not shown) is performed to spool report lines. These routines should never be altered by (cont.) you. The CB900-SPOOL routine consists of the insertion point %SPOOL. The Default logic for %SPOOL includes the library (cont.) member named SPOOLIT. You can override this default spooling routine by coding customization for %SPOOL, if you (cont.) wish. ``` JA100-LOGICAL-JOIN. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * LOGICALLY JOIN SECONDARY DATA FILES TO THE PRIMARY FILE * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * MOVE TWA-DB-REQUEST TO TWA-DB-REQ-SAV. * * * CUSTOM ALGORITHM %JOIN STARTS HERE IF (NOT-FOUND) GO TO JA900-RETURN. MOVE REDKY TO TWA-DB-CMD. MOVE 'SIFK1' TO TWA-DB-KEY-NAME. MOVE 'SIF01' TO TWA-ELT-LIST. MOVE LOW-VALUES TO SIF01-LOVALU. MOVE VAC01-EMPNUM TO SIF01-EMPNUM. MOVE SIF01-MASTER-KEY TO TWA-KEY-VALUE. CALL 'MAGECSET' USING TWA-DB-AREA-A SIF01-ELEMENT. PERFORM AA840-CALL-MAGEC-IO THRU AA899-EXIT. IF (NOT-FOUND) MOVE SPACES TO SIF01-ELEMENT GO TO JA900-RETURN. * * * CUSTOM ALGORITHM %JOIN ENDS HERE JA900-RETURN. MOVE TWA-DB-REQ-SAV TO TWA-DB-REQUEST. MOVE THIS-PGMS-ELEMENTS TO TWA-ELT-LIST. JA999-EXIT. EXIT. ``` This is the JA100 routine which is performed from every "read" routine immediately after reading the primary file (cont.) record. It is where you can code the reads for as many other files as you like to construct a "logical record" for the (cont.) MMP to process against. The insertion point named %JOIN is an extremely important one and you will find it very useful. You can not only read (cont.) other files but also compute values into VARIABLE-STORAGE fields which may be specified as "Source/Target" fields to be (cont.) displayed on the screen. Using this insertion point wisely can greatly simplify your MMP's logic and your work. The code shown in this example (cont.) was generated in the Automatic Logical Join process during the development of this application. The coding found in the %JOIN insertion point could be placed there in any of several ways. It could be manually coded (cont.) by the developer as ordinary customization coding, it could be generated via the semi-automated development process (cont.) which requires some programmer input, or it could be generated using the fully-automated development process which (cont.) requires no programmer input. Regardless how it got there, it can be altered or added to online via the standard (cont.) customization processes. ``` *************************************************** * MISCELLANEOUS * * USER-CODED CUSTOM SUBROUTINES WILL BE PLACED * * BELOW. * * * *************************************************** * * * DEFAULT ALGORITHM %SUBRTNL STARTS HERE Next: https://magec.com/DOC/markdown/genmmp21.md.txt