***********************************************************************
* BA200
* INITIALIZE SCREEN FIELD ATTRIBUTES
*
***********************************************************************
BA200-INIT-ATTRIBUTES.
IF (MAINT-FUNCTION)
GO TO BA210-MAINT-SCREEN.
BA205-LOCAT-SCREEN.
MOVE SPACES TO MSK652-SCOMPL
FATAL-ERR.
MOVE ATSADRNF TO MSK652-SLISTA.
MOVE ATSADHNF TO MSK652-SCOMPLA
MSK652-SHDGA
MSK652-SERRMSGA.
MOVE ATUADRNM TO MSK652-SKEYA
MSK652-SFUNCTA.
MOVE SPACES TO MSK652-SKEYE
MSK652-SCOMPLE
MSK652-SERRMSGE.
IF (SCN-FUNCTION) OR (FND-FUNCTION)
OR (TWA-MSK-PF13-HIT)
MOVE ATUADHNM TO MSK652-SDOTMSKA
ELSE
MOVE ATSANRNF TO MSK652-SDOTMSKA.
IF (FND-FUNCTION)
MOVE ATSADRNF TO MSK652-SSARGLTA
MOVE ATUADHNF TO MSK652-SSEARCHA
ELSE
MOVE ATSANRNF TO MSK652-SSARGLTA
MSK652-SSEARCHA.
MOVE ATSADHNF TO MSK652-SHDGA.
MOVE HDG-LINE TO MSK652-SHDG.
MOVE SPACES TO MSK652-SLIST.
MOVE NOT-FOUND-MSG TO MSK652-SLINE (1).
GO TO BA299-EXIT.
BA210-MAINT-SCREEN.
IF (SEE-FUNCTION)
MOVE FOUR TO TWA-MSK-CUR-AD-OT
ELSE
MOVE STD-CUR-AD-OT TO TWA-MSK-CUR-AD-OT.
IF TWA-DB-RETURN-CODE EQUAL GA-LIT
MOVE SPACES TO TWA-DB-RETURN-CODE
ELSE
MOVE SPACES TO SCOMPL.
MOVE SPACES TO SERRMSG
SFUNCTE
SKEYE
SCOMPLE
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
next: genmmp20.md.txt