MOVE 'SIF01' TO TWA-ELT-LIST. 04
MOVE LOW-VALUES 05
TO SIF01-LOVALU. 06
MOVE VAC01-EMPNUM 07
TO SIF01-EMPNUM. 08
MOVE SIF01-MASTER-KEY TO TWA-KEY-VALUE. 09
CALL 'MAGECSET' USING TWA-DB-AREA-A SIF01-ELEMENT. 10
PERFORM AA840-CALL-MAGEC-IO THRU AA899-EXIT. 11
IF (NOT-FOUND) 12
MOVE SPACES TO SIFO1-ELEMENT 13
GO TO JA900-RETURN. 14
15
Move CURSOR to a line, use ERASE EOF to Delete it -or- PF20 to Insert After it
Semicolon (;) is the TAB Character Asterisk (*) in col. 1 = suppress upcase
Press PF24 for Instructions
```**
Figure 07 -- Code Created by Automatic Logical Join
##
Coding Computations
The MAGEC Online Librarian permits you to use the semicolon ( ; ) as a TAB character. On the ruler line you will notice (cont.)
semicolons showing where the TAB positions are set. You could just key semicolons on the ruler line, overriding the (cont.)
ones that are shown, to alter the TAB position to suit yourself. There is no need to do that now, (cont.)
though.
| ```
**     DO THIS:
Key in the coding exactly as shown and press ENTER.
   
```**
The semicolons will cause your coding to be aligned to the pre-set TAB positions (columns 12, 16, etc.). It is not (cont.)
necessary for you to use the TAB's; you could just space over to the desired column. TAB's make entering Cobol coding a (cont.)
little easier, though.
| ```
**
ALGNXT 600/JOIN/01-SIF/000 Press ENTER to Update
SEARCH ARG:............................................................
......
Password: M A G E C JOIN page
CUSTOM ALGORITHM DEFINITION FOR MSK 600 01-SIF (000)
Logical Join - secondary files TAB Option (PF14=ON/OFF): ON
....+..;10.;..+;..20....+...30....+...40....;+...50....+...60....+...70..
IF (NOT-FOUND) GO TO JA900-RETURN. 01
;;COMPUTE VACATION-DUE = 02
;;;VAC01-EARNED-VACATION - VAC01-TAKEN-VACATION. 03
;;COMPUTE SICK-DUE = 04
;;;VAC01-EARNED-SICK-DAYS - VAC01-TAKEN-SICK-DAYS. 05
;;COMPUTE COMP-DUE = 06
;;;VAC01-EARNED-COMP-DAYS - VAC01-TAKEN-COMP-DAYS. 07
;;COMPUTE TOTAL-DUE = 08
;;;VACATION-DUE + SICK-DUE + COMP-DUE. 09
10
11
12
13
14
15
Move CURSOR to a line, use ERASE EOF to Delete it -or- PF20 to Insert After it
Semicolon (;) is the TAB Character Asterisk (*) in col. 1 = suppress upcase
Press PF24 for Instructions
```**
** NOTE: The semicolon (;) is the tab character. You can set the tab positions merely by typing semicolons into the (cont.)
ruler line which is immediately above the first line of Cobol code. The default positions for the tabs are oriented to (cont.)
most Cobol programmers' preferences. You can adjust according to your own taste. To remove a tab position, just (cont.)
overtype the semicolon in the ruler line with any other character, such as a dot (.).
Figure 08 -- Inserting More Custom Coding in %JOIN
##
New Customized %JOIN Algorithm
Notice that the display now shows your new Cobol coding inserted into the old code, just like you intended it to be. (cont.)
When you inserted your new code, MAGEC had to add another "page" to the %JOIN member since there are now more lines of (cont.)
code than can fit onto one "page". Each "page" holds 15 lines, one screenful. If you wish to see the rest of the Cobol (cont.)
code you can press PF8 to page forward.
| ```
     DO THIS:
Press PF12 (Shift-F2, on a PC) now to return to the TSKLST.
   
```**
| ```
**
ALGNXT 600/JOIN/01-SIF/000
SEARCH ARG:............................................................
......
Password: M A G E C JOIN page
CUSTOM ALGORITHM DEFINITION FOR MSK 600 01-SIF (000)
Logical Join - secondary files TAB Option (PF14=ON/OFF): ON
....+..;10.;..+;..20....+...30....+...40....;+...50....+...60....+...70..
IF (NOT-FOUND) GO TO JA900-RETURN. 01
COMPUTE VACATION-DUE = 02
VAC01-EARNED-VACATION - VAC01-TAKEN-VACATION. 03
COMPUTE SICK-DUE = 04
VAC01-EARNED-SICK-DAYS - VAC01-TAKEN-SICK-DAYS. 05
COMPUTE COMP-DUE = 06
VAC01-EARNED-COMP-DAYS - VAC01-TAKEN-COMP-DAYS. 07
COMPUTE TOTAL-DUE = 08
VACATION-DUE + SICK-DUE + COMP-DUE. 09
MOVE REDKY TO TWA-DB-KEY-CMD. 10
MOVE 'SIFK1' TO TWA-DB-KEY-NAME. 11
MOVE 'SIF01' TO TWA-ELT-LIST. 12
MOVE LOW-VALUES 13
TO SIF01-LOVALU. 14
MOVE VAC01-EMPNUM 15
Move CURSOR to a line, use ERASE EOF to Delete it -or- PF20 to Insert After it
Semicolon (;) is the TAB Character Asterisk (*) in col. 1 = suppress upcase
Press PF24 for Instructions
```**
Figure 09 -- New Customized %JOIN Algorithm
##
Adding Fields to Mask
Next you must return to the "manual" Screen Painting function to add four new screen fields to Mask 600. The four new fields are to display the four calculated figures.
| ```
**     DO THIS:
Position the cursor down to PAINT SCREEN, and press ENTER.
   
```**
You will be immediately transferred to the MSKDEF screen.
| ```
**
TSKLST 600 PF8 = next page -- PF5 = Page 1
M A G E C TASK LIST FOR MSK600
...............T A S K......................... PAGE 1 .....STATUS......
I. DEFINE APPLICATION TO DICTIONARY
1. DEFINE SCREEN HEADER DONE
2. DEFINE MMP DONE
II. VERIFY THAT FILES/DATABASE ARE DEFINED
1. DEFINE MASTER KEY & NORMALIZATION RULES DONE
2. DEFINE SUBORDINATE KEY(S) NOT DONE
III. DEFINE SCREENS
_1. PAINT SCREEN / DEFINE MASK DETAIL 29 DONE
2. SELECT FIELDS FOR LOCATE SCREEN 5 DONE
3. SPECIFY LOCATE HEADINGS 5 DONE
4. GENERATE MASK (EXECUTE MSKCREAT) DONE
IV. CODE CUSTOMIZATION ALGORITHMS
A. DATA DIVISION
1. DATA DEFINITIONS %DATADEF 1 DONE
2. ADD/MODIFY FUNCTION CODES %FUNCT DEFAULT LOGIC USED
3. MODIFY (MODMAINT) FUNCTION CODES %FUNCTM DEFAULT LOGIC USED
Position the Cursor on an Item and Press ENTER to Select it, Press PF2 for
Item Description -OR- PF1 FOR HELP
KEY = MASK NUMBER
```**
Figure 10 -- Task List Screen, page 1
##
Manual Screen Painting
Mask 600 will be displayed. On the MSKDEF screen you can make any changes or additions that you wish. You can modify or (cont.)
delete existing screen fields or you can add new ones by simply drawing them just as you want them to (cont.)
look.
| ```
**     DO THIS:
Turn to the next page in this book.
   
```**
| ```
**
MSKDEF 600 Press PF10 to MSKCREAT
Date:@ > @VACATION/SICK/COMP DAYS> @Time:@XX:XX:XX>
@Emp#@999-99-9999>
@First Name@--------------->
@Last Name@------------------------>
@Hire Date@-------->
@Earned Vacation@---------->
@Vacation Taken@---------->
@Sick Days Earned@---------->
@Sick Days Taken@---------->
@Comp Days Earned@---------->
@Comp Days Taken@---------->
@Comments (3 lines)@---------------------------------------------->
@---------------------------------------------->
@---------------------------------------------->
MAGEC SCREEN PAINTER (PFKEYS) --FIELD: 18=CHG 19=DEL 20=DUP 21=MOVE
LAST GEN=93 08 05 --LINE: 4=DUP 5=ERASE 6=MOVE 13=DEL 15=INS
LAST UPD=93 06 22 2494 BYTES MAX, 1016 USED, 1478 LEFT PF24=POP-UP HELP
```**
Figure 11 -- Mask 600 Displayed
##
Drawing New Fields onto MSKDEF
You can use the symbols < and > to show where each new field starts and ends respectively. If one field immediately (cont.)
follows another then you do not need to "stop" the first one since MAGEC knows that they are not allowed to overlap and (cont.)
it assumes that the first one ends before the following one starts.
When you draw the fields, you can just key in the actual literal value you wish them to contain (for screen headings (cont.)
and constants). If you draw them with all X's or all 9's then MAGEC assumes that they are to be "variable"* (enterable, (cont.)
unprotected) fields and changes the X's or 9's to underscores as well as setting appropriate Attributes, etc. If you (cont.)
draw the field using a literal value (such as Due, in the example), MAGEC assumes that the field is a *constant* (cont.)
(non-enterable, protected), rather than a variable.
There are many more things you can do on MSKDEF. For full instructions you can press the HELP key (PF1).
| ```
**     DO THIS:
Draw the 8 new screen fields exactly as shown on the opposite page.
Each variable field consists of thirteen 9's. Then press ENTER.
   
```**
You could draw the new fields one at a time or all at once. There are eight (8) new fields, four constants and four (cont.)
variables. We will want to make these variables display-only, so we will need to modify the Attribute from what MSKDEF (cont.)
defaulted to. We also need to specify the database source/target names for these variables. They will be the work (cont.)
fields we defined earlier in %VARSTOR.
**
NOTE:
**
You might say that we have created "virtual database fields" in this exercise since we have defined four work fields (cont.)
and, in %JOIN, we computed into them. The program logic can now treat them as if they were actually part of the input (cont.)
data.
In the basic application development process we let the Automatic Logical Join feature "logically join" the SIF01 (cont.)
Element from the SIF Data Class to the data from the Primary Data Class (VAC). Now you have logically joined some (cont.)

next: cstm04.md.txt