ADD COMP-DUE TO COMP-DUE-ALL 05 ADD TOTAL-DUE TO TOTAL-DUE-ALL 06 MOVE 'VACATION DAYS ======' TO DISPLAY-TITLE 07 MOVE VACATION-DUE-ALL TO DISPLAY-TOTAL 08 MOVE DISPLAY-LINE TO MSK652-SLINE (1) 09 MOVE 'SICK DAYS ==========' TO DISPLAY-TITLE 10 MOVE SICK-DUE-ALL TO DISPLAY-TOTAL 11 MOVE DISPLAY-LINE TO MSK652-SLINE (2) 12 MOVE 'COMP DAYS ==========' TO DISPLAY-TITLE 13 MOVE COMP-DUE-ALL TO DISPLAY-TOTAL 14 MOVE DISPLAY-LINE TO MSK652-SLINE (3) 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 36 -- First Page of Custom Code for %SELECT Next, use ALGADD again to add page 2. | ``` **     DO THIS: Alter the command to: ALGADD 600/SELECT/VACTOT/2 . . . press ENTER.     ```** The %SELECT Proforma will reappear (not shown on opposite page) ready for you to enter more Custom coding to be inserted into the SELECT Insertion Point. | ``` **     DO THIS: Overkey the Proforma exactly as shown - press ENTER.     ```** Again, the ALGNXT screen will display your second page of Custom code. You can page forward and backward to visually scan your coding, by pressing the PF8 and PF7 keys, respectively. ** ** ** NOTE: ** After you have keyed in the first page of text (as in Figure 36) you could cause MAGEC to automatically create page 2 (cont.) rather than having to manually type the ALGADD command as above. To do that you would place the cursor anywhere in the (cont.) body of your text, but above line 15, and press PF20. PF20 is the insert key, it causes the screen to "open up" in (cont.) preparation for you to insert more text after the line your cursor was on and before the line following it. When you do (cont.) that on a screen which is already full (all 15 lines used) MAGEC will automatically add another page to contain the (cont.) overflow, even if you do not key any more lines into the opened up screen. Then just pressing ENTER will update the (cont.) member; the last line from page 1 will be overflowed to the new page 2. Now, pressing PF8, or just ENTER again, will (cont.) page forward to page 2. Since you would not be doing the ALGADD function MAGEC would not present the proforma, (cont.) either. ** NOTE: ** The work field named LIN-CTR is a subscript used by the standard logic when it moves the display lines into the screen. It is also tested in the mainline to determine whether the screen is full. | ``` ** ALGNXT 600/SELECT/VACTOT/2 Data ADDED to Database SEARCH ARG:............................................................ ...... Password: M A G E C SELECT page CUSTOM ALGORITHM DEFINITION FOR MSK600 VACTOT (002) SELECTION CRITERIA FOR BROWSES TAB Option (PF14=ON/OFF): ON ....+..;10.;..+;..20....+...30....+...40....+...50....+...60....+...70.. MOVE 'TOTAL DAYS =========' TO DISPLAY-TITLE 01 MOVE TOTAL-DUE-ALL TO DISPLAY-TOTAL 02 MOVE DISPLAY-LINE TO MSK652-SLINE (4) 03 MOVE FIVE TO LIN-CTR 04 MOVE 'TOTALS - ALL EMPLOYEES' TO MSK652-SHDG. 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 PF24 for Instructions ```** Figure 37 -- Second Page of Custom Code for %SELECT ## Recompile and Test | ``` **     DO THIS: Press PF15 to exit MAGEC. Resubmit MMPCREAT. Check the listing.     ```** | ``` **     DO THIS: If you are using a mainframe, use the appropriate New Copy command.     ```** | ``` **     DO THIS: Use the TS01 TransID to get back into MAGEC.     ```** ## Define New Function to Security In order to execute the new VACTOT function, it must first be defined to the MAGEC security system. We will not describe the tasks of the Security Officer in this chapter since your company may wish to restrict access (cont.) to the Security System's functions. To avoid delays, we have taken the liberty of predefining VACTOT to the system. (cont.) Therefore, it is not necessary for you to ask the Security Officer to do it. Defining a new function can be done online (cont.) in less than one minute and it takes effect immediately. Refer to the MAGEC "Security" chapter for more (cont.) information. The Security Officer uses the command: FCDADD VACTOT     to define your new function code. | ``` **     DO THIS: Have your Security Officer define the new function to the Security System (if it is not already defined). You may do it yourself if you are authorized. Refer to the notes below.     ```** ** NOTE: ** You can look at the function code definition for VACTOT by doing the FCDSEE VACTOT     command, if the definition already exists. ** NOTE: ** If you add a new function code definition, you must do the **LOAD command to tell MAGEC to reload its in-memory images of security parameters before you can test that new function. ** NOTE: ** The easiest way to add the VACTOT function code definition to the repository is to duplicate the VACLOC function code definition. To do this you would: 1). type the command FCDSEE VACLOC, and press ENTER 2). alter the command to FCDDUP VACTOT, and press ENTER ## Test New Function | ``` **     DO THIS: Enter the command: VACTOT . . . press ENTER.     ```** Your new function will read all the employees' VAC data and tally the grand totals and display them to you. You have now completed Sample Project 3. You should now have a good working understanding of how to use the MAGEC (cont.) Customization screens and Insertion Points. Of course, there are an infinite number of other types of customization (cont.) which you can do. These projects have set you off to a good start with MAGEC. You will find that you can use MAGEC for 100% of your (cont.) Online Applications development since you can do anything with MAGEC that you could do with Cobol or "C" or Assembler (cont.) language (it is permissable in MAGEC to CALL other-language subroutines). You may wish to re-read this chapter, paying closer attention to the explanations on each page, in order to reinforce (cont.) your understanding. The Appendices in the back of this chapter and in the back of the chapter titled "Application (cont.) Developer", will be continually helpful to you as reference material. | ``` ** VACTOT 000000000 END OF LIST - PF5=Restart/PF7=Backward TOTALS - ALL EMPLOYEES VACATION DAYS ======= 1,234.56 SICK DAYS =========== 126.70 COMP DAYS =========== 55.00 TOTAL DAYS ========== 1,416.26 ++++ 23 Records Scanned, 00 Displayed so far - page 1 ++++ Key 1 = Employee# (9-digits) Press PF13 for Hardcopy You may position the CURSOR to an item and Press ENTER to "SEE" it (Browsing Forward) or Press PF4 to "CHG" it ```** Figure 38 -- VACTOT Display # Test Project 4 ## Chaining Screens ** WARNING! ** This project calls for some research and some thinking on your part. It is intended to get you started using the (cont.) manuals, especially the Appendices at the end of each tutorial section, to help solve real-world problems. It also (cont.) teaches you how to test for PF keys and how to chain from screen to screen programmatically. This time we will let you figure out how to do a small project on your own. The solution is in this book, immediately (cont.) following this project description. We recommend that you try to solve the problem first, then look at the (cont.) solution. There are a set of standard functions for accessing the Security Information File (SIF), just like the ones you have (cont.) just created for the VAC file. We would like to have the ability to transfer to the SIFSEE screen from any VAC (cont.) maintenance screen (VACSEE, VACCHG, etc.) for the same employee. In other words: if you were looking at the VACSEE (cont.) screen for employee 12 you should be able to press a PF key to immediately see the SIFSEE screen for employee (cont.) 12 without having to type in any command. For the sake of this project let's use PF6 to do that. The opposite page contains some helpful hints which should make the project easier for you. You might wish to keep in mind that the generated MMP now supports ten functions, they are categorized into two (cont.) classes: *maintenance functions* and *browse functions*. In this project we are interested in providing the ability to (cont.) transfer from any of the maintenance functions (VACADD, VACCHG, VACDEL, VACSEE, VACNXT, VACDUP) to the SIFSEE function. (cont.) We are not trying to transfer from any of the browse screens (though that is no more difficult to (cont.) do). | ``` **     DO THIS: Read these instructions and the hints on the facing page. Browse through the Appendices for more help.     ```** ## Helpful Hints The appendices of this book will help you to know how to transfer to another function or screen. They will also help (cont.) you to know how to sense which PF key was pressed. They will also help you to find the customization insertion point (cont.) appropriate to accomplish what you want to do. You will want to insert customization to sense the PF key from the maintenance screen. The insertion point names are generally mnemonic so that you can more easily remember them. Next: https://magec.com/DOC/markdown/cstm08.md.txt