**Note:** It is not necessary for you to use the Shift key to enter uppercase alphabetic characters on this screen. (cont.)
MAGEC will automatically change any lowercase alphabetic characters to uppercase for you. All the Librarian entry and (cont.)
update screens automatically translate to uppercase to simplify your work since Cobol, Assembler, and even JCL are all (cont.)
coded in uppercase only (Cobol II accepts lowercase coding as equivalent to uppercase coding).
If you *do* wish to enter text in lowercase and *not have it converted* to uppercase, you must type an asterisk (*) in column 1 of each line which you do not want converted to uppercase.
```
ALGADD 600/VARSTOR
** SEARCH ARG: ..................................................................
Password: M A G E C VARSTOR page
New Password: CUSTOM ALGORITHM DEFINITION FOR MMP 600
add items to VARIABLE STORAGE TAB Option (PF14=ON/OFF): ON
....+..;10.;..+;..20....+...30....+...40....+...50....+...60....+...70..
05 VACATION-DUE PIC S9(7)V99 COMP-3. 01
05 SICK-DUE PIC S9(7)V99 COMP-3. 02
05 COMP-DUE PIC S9(7)V99 COMP-3. 03
05 TOTAL-DUE PIC S9(7)V99 COMP-3. 04
05
06
07
08
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 PF2 for Instructions Press PF4 for menu of Named Proformas
```
Figure 04 — Your Custom Coding in %VARSTOR
## Entering Procedure Division Code
The TSKLST (page 1) will appear.
Do this:** Press PF8 to page forward to page 2.
The screen will look like the one shown here. Notice that the status of the %VARSTOR task now indicates "1 DONE". That means that you have added one "page" (record) of coding for %VARSTOR.
Next you must enter the PROCEDURE DIVISION coding to calculate the figures into the four work fields you have defined. For our purposes we will insert that coding into the "Logical Join" routine.
The routine named JA100-LOGICAL-JOIN is performed by the MMP after every READ of the Primary Data Class. When you did (cont.)
the Automatic Logical Join sequence in the basic development process (see MAGEC "Application Developer" Tutorial) MAGEC (cont.)
automatically generated a piece of Customization coding to be inserted into JA100-LOGICAL-JOIN. The name of the (cont.)
insertion point is %JOIN.
**Do this:** Press PF8 to page forward to page 3.
```
TSKLST 600 PF8 = Next Page -- PF5 = PAGE 1
** M A G E C TASK LIST FOR MSK600
...............T A S K......................... PAGE 2 .....STATUS......
IV. CODE CUSTOMIZATION ALGORITHMS (CONTINUED)
4. DATA CONSTANTS %LITERAL DEFAULT LOGIC USED
5. Special SECTION-NAME for IDMS %SCHEMA DEFAULT LOGIC USED
6. DEFINE user work area %USRAREA DEFAULT LOGIC USED
7. add items to VARIABLE STORAGE %VARSTOR 1 DONE
B. INITIALIZATION
1. MAINT. FUNCTION INITIALIZATION %INIT DEFAULT LOGIC USED
2. ATTRIBUTE INITIALIZATION %INITATB DEFAULT LOGIC USED
3. BROWSE FUNCTION INITIALIZATION %LOCINIT DEFAULT LOGIC USED
4. PRE INITIALIZATION ROUTINE %PREINIT DEFAULT LOGIC USED
C. SCREEN HANDLING
1. INITIALIZE SCREEN (BLANK SCREEN) %BLNKSCR DEFAULT LOGIC USED
2. COMPUTATIONS FOR SCREEN DISPLAY %COMP DEFAULT LOGIC USED
3. SCREEN FIELD EDIT(S) %EDIT DEFAULT LOGIC USED
4. PHASE 2 EDITS %EDIT2 DEFAULT LOGIC USED
5. ADDITIONAL DATA TO BROWSE SCREEN %LOCMOV 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 05 — Status Showing Customization Done
## Select Logical Join Task
Notice that the TSKLST shows that there is one "page" of code on file for %JOIN already. That is what the Automatic Logical Join feature generated.
Do this:** Position the cursor down to the %JOIN task, press ENTER.
You will be transferred to the screen showing the existing code which is on file.
```
TSKLST 600 PF8 = next page -- PF5 = Page 1
**
M A G E C TASK LIST FOR MSK600
...............T A S K......................... PAGE 3 .....STATUS......
IV. CODE CUSTOMIZATION ALGORITHMS (CONTINUED)
6. ADD'L EDIT ROUTINE MMP MAINT KEY %NORMKEY DEFAULT LOGIC USED
D. DATA BASE COMMANDS
1. INITIALIZE RECORD FOR ADD %ADDINIT DEFAULT LOGIC USED
2. LOGIC TO ADD TO DATABASE %ADDIT DEFAULT LOGIC USED
3. LOGIC TO DELETE FROM DATABASE %DELET DEFAULT LOGIC USED
4. Logic to JOIN secondary files %JOIN 1 DONE
5. LOGIC TO 'SETL' ON DATABASE %LOCKY DEFAULT LOGIC USED
6. READ FOR UPDATE ROUTINE (CHANGE) %RDUKY DEFAULT LOGIC USED
7. READ FOR DISPLAY ROUTINE %REDKY DEFAULT LOGIC USED
8. LOGIC TO READ FIRST RECORD %REDLE DEFAULT LOGIC USED
9. LOGIC TO READ-NEXT RECORD %REDNX DEFAULT LOGIC USED
10. LOGIC TO DROP EXCLUSIVE CONTROL %RELES DEFAULT LOGIC USED
11. LOGIC TO UPDATE THE DATABASE %UPDAT DEFAULT LOGIC USED
E. SCREEN NAVIGATION
1. MMP EXIT LOGIC %GOBACK DEFAULT 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
```
*
NOTE: The status of the %JOIN customization task shows "1 DONE", meaning that there is one (cont.)
"page" of customization coding in the repository for the insertion point, for this application. Since you have not done (cont.)
any customization for %JOIN yet, you might wonder how that could be correct. When you did the initial development of (cont.)
MMP600 in the first project, you used the Fully-Automated method. MAGEC automatically generated the necessary Cobol (cont.)
coding to read the SIF01 data using the Employee number from the Vacation data as a "foreigh key". This generated Cobol (cont.)
code was added to the repository as custom code for the %JOIN insertion point so that you could easily access it to (cont.)
make any alterations you might desire.
Figure 06 — Task List Screen, page 3
## Modifying Customization Code
The screen will be displayed to you as shown on the facing page. You are going to insert some additional Cobol coding (cont.)
near the top of this routine, after the first line of the coding which is displayed.
This means that you will be inserting using the PF20 key. Refer to the MAGEC "Librarian" chapter for full instructions or press PF1 for HELP.
Do this:** Place the cursor on the first line of code, press PF20 (Shift F10 on PC).
This will "open up" the screen by temporarily "shoving down" all the lines of code below where you placed the cursor to allow you to key new code into the screen.
**Note:** The "IF (NOT-FOUND)" coding on the first line of the screen tests whether the Primary data (VAC) was (cont.)
successfully read. If it was not, then we do not want to try to do computations using fields from it, nor would we want (cont.)
to try to read the SIF data.
If the VAC record was not found, then this routine will simply bypass its processing and effectively "do nothing". The (cont.)
mainline logic of the generated MMP will not attempt to use any of the data from the records because it too tests for (cont.)
the NOT-FOUND condition.
```
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
MOVE REDKY TO TWA-DB-CMD. 02
MOVE 'SIFK1' TO TWA-DB-KEY-NAME. 03
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 (cont.)
semicolons into the ruler line which is immediately above the first line of Cobol code. The default positions for the (cont.)
tabs are oriented to most Cobol programmers' preferences. You can adjust according to your own taste. To remove a tab (cont.)
position, just 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
Next: https://magec.com/DOC/markdown/cstm03.md.txt