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 below. 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 (cont.) fields and, in %JOIN, we computed into them. The program logic can now treat them as if they were actually part of the (cont.) input 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.) virtual database fields to it. The result is a "Logical Record" made up of data from the VAC and SIF Data Classes (two files) and some work fields. (cont.) The MMP will use the Logical Record as if it were one large record read from one file. You could easily have joined (cont.) many more Elements of data from other Data Classes which might even use other access methods. Your MMP's are very (cont.) highly isolated from the physical attributes of your database. ``` 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@----------> <Due<9999999999999> @Sick Days Earned@----------> @Sick Days Taken@----------> <Due<9999999999999> @Comp Days Earned@----------> @Comp Days Taken@----------> <Due<9999999999999> @Comments (3 lines)@----------------------------------------------> @----------------------------------------------> @----------------------------------------------> <Total Days Due<9999999999999> 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 12 — Drawing New Screen Fields ## MSKDEF Recognizes Your New Fields Notice that MSKDEF recognized the newly drawn fields and added the definitions for them to the Dictionary. It also re-drew the Mask to show you how it now looks. The "Attribute positions" for the new fields have been altered from the < symbol which you keyed to either the d was a constant then the iel le then the | symbol appears. The | symbol indicates that this is a "virgin variable", one which has been added but whose field characteristics have not yet been updated. The default field characteristics which MAGEC sets for screen constants are almost always 100% correct and need no modification. You can, of course, modify them if you like. The default characteristics MAGEC sets for new screen variables often need to be reviewed and modified or added to by (cont.) you. That is why the virgin variables are brought to your attention by the | symbol and the cursor "homes" to them. (cont.) Notice the cursor position. The "homing" cursor makes it easy for you to select the new variables to change their characteristics. **Do this:** With cursor on first new variable, press PF18. You have selected the first variable for change. ``` 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@----------> @Due|-------------> @Sick Days Earned@----------> @Sick Days Taken@----------> @Due|-------------> @Comp Days Earned@----------> @Comp Days Taken@----------> @Due|-------------> @Comments (3 lines)@----------------------------------------------> @----------------------------------------------> @----------------------------------------------> @Total Days Due|------------> 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, 1151 USED, 1343 LEFT PF24=POP-UP HELP ``` Figure 13 — Virgin Variables Displayed ## Updating Field Characteristics The pop-up windoiw now shows the field characteristics for the selected field. You can overkey any of them to change them. You can even change the ROW and COLumn to move the screen field. Do this:** Notice the pop-up window -- turn to next page in this book. ``` MSKDEF 600 -- HIT ENTER TO CHANGE -- ** Date:@ > @VACATION/SICK/COMP DAYS> @Time:@XX:XX:XX> @Emp#@999-99-9999> @First Name@---------------> @Last Name@------------------------> @Hire Date@--------> @Earned Vacation@----------> @Vacation Taken@----------> @Due|-------------> @Sick Days Earned@----------> @Sick Days Taken@----------> @Due|-------------> @Comp Days Earned@----------> @Comp Days Taken@----------> @Due|-------------> @Comments (3 lines)@----------------------------------------------> @----------------------------------------------> @----------------------------------------------> @Total Days Due|-------------> 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, 1151 USED, 1343 LEFT PF24=POP-UP HELP ``` * Figure 14 — Selected Field's Default Characteristics You will now change the specifications for the first variable to: 1) Give it a Cobol name: SVACDUE 2) Alter its Attribute to Skip-protected: SADRNF 3) Alter its Edit-Type to: " " (minus-sign) 4) Define its dimensions: PIC S9(7)V9(2) 5) Define it as an "optional" field. 6) Specify its Source/Target: VACATION-DUE Do this:** Key the specifications as shown, press ENTER. **Note:** If you are using MAGEC in a GUI (Graphical User Interface) environment, the pop-up windows can be dragged (cont.) (using the mouse) to anywhere on the screen. In a character (text) environment, the pop-up window appears in a fixed (cont.) position and cannot be moved using a mouse. ``` MSKDEF 600 -- HIT ENTER TO CHANGE -- ** Date:@ > @VACATION/SICK/COMP DAYS> @Time:@XX:XX:XX> @Emp#@999-99-9999> @First Name@---------------> @Last Name@------------------------> Next: https://magec.com/DOC/markdown/cstm04.md.txt