```**
| ```
** 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.
When you are adding customization to an insertion point for which there is default logic, you will usually be presented (cont.)
with a proforma (on the screen) which resembles the default logic. It is usually easiest to then just press ENTER, (cont.)
adding the code from the screen to the dictionary as custom code, then to edit the new custom code. You can insert (cont.)
additional coding plus retain the default coding in that manner.
The solution is just below here.
##
Solution to Test Project 4
To accomplish the objective of Test Project 4, from the prior page, you should have added the following statement into the %PFKEYM insertion point for application 600:
IF (TWA-MSK-PF6-HIT)
**
MOVE QUOTE TO TWA-MSK-AID
MOVE FTH-FUNCT TO TWA-NONTP-REQUEST
MOVE 'SIFSEE' TO SFUNCT
GO TO AA900-GOBACK.
The sequence of the MOVE's is not important. The MOVE QUOTE TO TWA-MSK-AID is optional, but it is a good idea.
You should have added this code by doing:
ALGADD 600/PFKEYM
**
proforma is displayed
**
press ENTER to add code from screen as new custom code
**
data is added, screen returns in "edit mode"
**
position cursor above first line of code, press PF20
**
screen "opens up" for lines to be inserted
**
type in the code shown above, press ENTER
**
new lines inserted, screen displays them
**
submit MMPCREAT (in batch)
**
**
NEW COPY as appropriate to your environment
**
**
NOTE:
**
The proforma for the %PFKEYM insertion point includes the logic to test for all the standard MAGEC/SAA PF keys. It also (cont.)
includes the logic to test for the situation in which an operator is doing an inquiry function and attempts to modify (cont.)
the displayed data. The default logic issues a message asking: Did you Intend to Change Data? The operator may then (cont.)
alter the Function Code to xxxCHG and press ENTER to complete the update. A popular alternative is to have the program (cont.)
bypass the question and automatically alter the function code to xxxCHG and to process the update immediately. Neither (cont.)
method bypasses any security since MAGEC will verify that this operator is allowed to do the CHG function before (cont.)
actually accepting it. The proforma for %PFKEYM shows the default logic commented out and the alternative logic added (cont.)
below it. If you want to retain the default method of asking the operator ratner than automatically processing the (cont.)
update, you must remove the asterisks from column 7 of the default code shown and remove the alternate logic below it. (cont.)
Otherwise, the program will do the automatic switch to the xxCHG function.
#
Project 5
##
Using Lookup Tables
**
NOTE:
**
By this time we assume that you have learned something from the earlier tutorials. This project gives you less (cont.)
"hand-holding" and leaves you to your own devices. It does give you liberal hints and suggestions to help you along, (cont.)
though.
MAGEC includes some very useful and powerful features associated with editing a screen field against a table of valid (cont.)
values. One obvious example of how these features can be used is in the validation of a State (or Province) code as (cont.)
part of an address.
| ```
** DO THIS:
This project will also require you to think about what you have learned so far.
Please read the instructions below .
```**
The Vacation file (Data Class VAC) actually contains more data than we have been using thus far in our tutorial (cont.)
projects. There is an Element named VAC02 which contains the City, State, and Zip (as in a U.S. street address) for (cont.)
each employee on the file. It is possible that for some of the employees there is not actually valid data in these (cont.)
fields, but merely the default value of spaces. That will become apparent to you when you try to access that (cont.)
data.
The very first screen you filled in when you initially began to develop the Vacation application was the Screen Header (cont.)
Definition. Refer to Figure 01 in the "Application Developer" tutorial. That screen (the SHDxxx screen) includes a (cont.)
parameter for the Verify Option. We initially set that option to NO. The verify option tells MAGEC whether to generate (cont.)
special code into your MMP which will protect against bad data which is read from your files and databases. As you (cont.)
know, Cobol programs ordinarily will abend if they try to access non-numeric data in a numeric field. Since we are now (cont.)
going to access Element VAC02, which we have said may contain non-numeric Zip codes (spaces), we should turn on the (cont.)
next: cstm12.md.txt