SERRMSGE. MOVE ATPADHNF TO SCOMPLA SERRMSGA. MOVE ATUADRNM TO SKEYA SFUNCTA. MOVE ATSADRNF TO SYSDATEA. MOVE ATSADRNF TO SYSTIMEA. MOVE ATSADRNF TO SEMPNUMA. MOVE ATSADRNF TO SFIRSTA. MOVE ATSADRNF TO SLAST-NA. MOVE ATUADRNF TO SDATE-HA. MOVE ATUADRNF TO SEARNEDA. MOVE ATUADRNF TO STAKENA. MOVE ATUADRNF TO SEARN07A. MOVE ATUADRNF TO STAKE08A. MOVE ATUADRNF TO SEARN09A. MOVE ATUADRNF TO STAKE10A. MOVE ATUADRNF TO SCOMMENA (001). MOVE ATUADRNF TO SCOMMENA (002). MOVE ATUADRNF TO SCOMMENA (003). * * * DEFAULT ALGORITHM %INITATB STARTS HERE * * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * * DEFAULT ALGORITHM %INITATB ENDS HERE BA299-EXIT. EXIT. ```** The BA200 routine sets all the screen field Atrributes to their initial values. The initial values are the ones the (cont.) Developer specified when he/she painted the Mask (via Automatic Screen Painting or MSKDEF). This routine is performed (cont.) for the Browse as well as the Maintenance Functions but the insertion point named %INITATB only allows you to add (cont.) Customization logic for the Maintenance Functions. | ``` ** **************************************************************** * BA300 NORMALIZE BROWSE KEY(S) * **************************************************************** * * * DEFAULT ALGORITHM %NKLOC STARTS HERE BA300-NORMALIZE-KEY. - - - - This routine suppressed - You should never touch it - - - BA399-EXIT. EXIT. * * * DEFAULT ALGORITHM %NKLOC ENDS HERE **************************************************************** * BA400 NORMALIZE MAINT KEY * **************************************************************** BA400-NORMALIZE-MAINT-KEY. - - - - This routine suppressed - You should never touch it - - - * * * DEFAULT ALGORITHM %NORMKEY STARTS HERE * * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * * DEFAULT ALGORITHM %NORMKEY ENDS HERE MOVE FILE-KEY TO NORMALIZED-KEY. GO TO BA499-EXIT. - - - - This routine suppressed - You should never touch it - - - BA499-EXIT. EXIT. ```** The Normalize Key routines are performed from the Mainlines at the appropriate times. There are two insertion points, (cont.) %NKLOC and %NORMKEY provided. If you wished to write your own Normalize Key logic for the Browse Functions then you (cont.) could use %NKLOC to replace the entire routine. It is not likely that you will often want to do that. The %NORMKEY (cont.) insertion point is positioned immediately before the Maintenance Normalize Key routine moves the key value from (cont.) FILE-KEY to NORMALIZED-KEY and then exits. FILE-KEY contains the completely formatted key, ready to use for reading the file. You might want to insert some of (cont.) your own additional editing here to be sure the key value is within certain ranges, etc.. If there were any errors (cont.) found in the key value entered then your Customization in %NORMKEY will not be executed since the routine will exit (cont.) immediately with the error flag set. Remember, you have an opportunity to intercept the key value before it gets to the (cont.) Normalize Key routine at the %PFKEYM and %PFKEYL insertion points. | ``` ** **************************************************************** * BA500 CHECK FILE STATUS (FSTAT) - * * VERIFY THAT A FILE IS OPEN BEFORE ISSUING A * * READ OR LOCATE, AND RETURN AN ERROR MESSAGE * * IN SCOMPL IF THE FILE IS NOT OPEN. * **************************************************************** BA500-CHECK-FSTAT. MOVE FSTAT TO TWA-DB-CMD. MOVE THIS-PGMS-ELEMENTS TO TWA-ELT-LIST. CALL 'MAGECSET' USING TWA-DB-AREA-A VAC01-ELEMENT PERFORM AA840-CALL-MAGEC-IO THRU AA899-EXIT. IF (FILE-CLOSED) MOVE TWA-DB-KEY-NAME TO FILE-CLOSED-NAME MOVE FILE-CLOSED-MSG TO SCOMPL MOVE SPACE TO TWA-LAST-FUNCT. BA599-EXIT. EXIT. ```** The BA500 routine is performed from the browse and maintenance mainlines to test whether the file is available and open. The FSTAT command tests File Status. | ``` ** **************************************************************** * BB100 * * CLEAR ALL UNPROTECTED FIELDS TO BLANKS OR DEFAULT VALUE * * EXCEPT SKEY AND SFUNCT * * * **************************************************************** BB100-BLANK-SCREEN. MOVE ALL '_' TO UNDERSCORE SDATE-H SEARNED STAKEN SEARN07 STAKE08 SEARN09 STAKE10 SCOMMEN (001) SCOMMEN (002) SCOMMEN (003). MOVE SPACE TO SPACE-CHR SYSDATE SEMPNUM SYSTIME SFIRST SLAST-N. IF (ADD-FUNCTION) AND (SCOMPL = SPACES) MOVE ENTER-DATA-TO-ADD TO SCOMPL. * * * DEFAULT ALGORITHM %BLNKSCR STARTS HERE * * * NO STANDARD DEFAULT CODE FOR THIS INSERTION POINT * * * DEFAULT ALGORITHM %BLNKSCR ENDS HERE SKIP2 BB199-EXIT. EXIT. ```** The BB100 routine initializes all the Unprotected (Enterable) fields on the screen to Underscores. It is performed in (cont.) the New Transaction phase of the ADD Function and when the MMP gets a NOT-FOUND return code for the key value entered (cont.) by the Operator. The %BLNKSCR insertion point is provided so that you might initialize some of your screen fields other than with the default Underscores. | ``` ** **************************************************************** * BB200 * * MOVE APPROPRIATE DATA FIELDS FROM RECORD TO SCREEN * * * **************************************************************** BB200-FILL-SCREEN. MOVE TWA-IPL-DATE-MM TO SYSDATE-MM. MOVE SLASH TO SYSDATE-SLASH-1. MOVE TWA-IPL-DATE-DD TO SYSDATE-DD. MOVE SLASH TO SYSDATE-SLASH-2. MOVE TWA-IPL-DATE-CC TO SYSDATE-CC. MOVE TWA-IPL-DATE-YY TO SYSDATE-YY. MOVE 'XX:XX:XX' TO PATTERN-MASK. MOVE TWA-TIME TO DE-EDITED-DATA. PERFORM CB200-INSERT-PATTERN THRU CB299-EXIT. MOVE SCREEN-FIELD TO SYSTIME. IF VAC01-EMPNUM NUMERIC MOVE '999-99-9999' TO PATTERN-MASK MOVE SPACES TO DE-EDITED-DATA MOVE VAC01-EMPNUM TO DE-EDITED-VALUE PERFORM CB200-INSERT-PATTERN THRU CB299-EXIT MOVE SCREEN-FIELD TO SEMPNUM MOVE VAC01-EMPNUM TO SEMPNUM-N ELSE MOVE ALL '*' TO SEMPNUM MOVE ZERO TO VAC01-EMPNUM MOVE 91A TO ERROR-NUMBER MOVE E TO SEMPNUME PERFORM CA100-LOAD-ERR-CODE-TBL THRU CA199-EXIT. MOVE SIF01-FIRST-NAME TO SFIRST. MOVE SIF01-LAST-NAME TO SLAST-N. MOVE VAC01-DATE-HIRED-MM TO SDATE-H-MM. MOVE SLASH TO SDATE-H-SLASH-1. MOVE VAC01-DATE-HIRED-DD TO SDATE-H-DD. MOVE SLASH TO SDATE-H-SLASH-2. MOVE VAC01-DATE-HIRED-YY TO SDATE-H-YY. COMPUTE SEARNED-N Next: https://magec.com/DOC/markdown/genmmp16.md.txt