verify option in order to protect ourselves.
We must also add Element VAC02 to the list of Elements to be accessed from the VAC Data Class.
| ```
** DO THIS:
Use the SHDCHG function to alter the Verify Option from NO to VERIFY, and to
add VAC02 as Element 2 under the Element Names parameters.
```**
Be sure you receive the message in SCOMPL, top right of the screen, which says: Data UPDATED on Database, otherwise, you probably entered something incorrectly.
| ```
** DO THIS:
Look at the screen shown in Figure 39. Our objective is to modify
the Vacation screen to look approximately like this.
```**
The new fields are highlighted by the shadow box. There are seven new fields. Three of them are Prompts (constants). (cont.)
Three of them are variables. and one of them is a "W-field" used to display the state name associated with the (cont.)
two-character state abbreviation code.
| ```
**
VACSEE 01
Date: 08/15/1993 VACATION/SICK/COMP DAYS Time: 01:15:03
Emp# 000-00-0001
First Name Harry
Last Name Houdini
Hire Date 12/31/87
Earned Vacation 14.50
Vacation Taken 2.25 Due 12.25
Sick Days Earned 124.50
Sick Days Taken 3.00 Due 121.50
Comp Days Earned 2.00
Comp Days Taken .00 Due 2.00
Comments (3 lines) Heavily into Escape literature.
Likes to be submerged while handcuffed and
strait-jacketed in a coffin-like vault
Total Days Due 135.75
City Waxahachie State TX Zip 75102
Texas
Press PF4 for browse (LOC) screen Press PF13 for Hardcopy
Press PF16 to Copy field to buffer Press PF17 to Paste data from buffer
Press PF2 for field-level HELP
```**
Figure 39 -- Address Data on Inquiry Screen
##
Manual Screen Painting
For this project we will have you use the manual screen painting facility, MSKDEF, which you have used before (refer to (cont.)
Figure 12 in this "Customization" tutorial) to add the new fields to the screen. That will help familiarize you with (cont.)
more of the specification parameters for screen fields.
You can draw the "constants by typing the literal values, i.e. "City", directly onto the screen exactly where you want (cont.)
them. Don't forget to use the less than symbol () to define the size of each field.
You can draw the "variables using either all X's or all 9's to indicate alpha-numeric or numeric fields. Only the Zip (cont.)
Code field is numeric, the others are alpha-numeric. The city name is 15 characters long, the state code is 2 (cont.)
characters long, and the zip code is 5 digits long. The "W-field" in which the state name is to be displayed should be (cont.)
approximately 20 characters long. Its size is not very critical since MAGEC will automatically truncate or pad the (cont.)
state name to make it fit into whatever size field you give it.
| ```
** DO THIS:
Use the MSKDEF function to draw the seven new screen fields onto Mask 600.
```**
Once you have drawn the new fields onto the screen you must modify the specifications for all but the three constant (cont.)
fields. To do this you use the PF18 key, as before. Each of the specification parameters will be shown with its default (cont.)
value, you overtype the default to alter it to the value you desire. The desired values are:
Scrn Fld (cont.)
NM Source/Target L (cont.)
gth Type -- R/O (cont.)
TBL#
city SCITY & (cont.)
nbsp; VAC02-CITY & (cont.)
nbsp;15 X &n (cont.)
bsp; "Required
state SSTATE   (cont.)
; VAC02-STATE 02 &n (cont.)
bsp; T "Required (cont.)
003
zip code SZIP &nbs (cont.)
p; VAC02-ZIP 05&nb (cont.)
sp; N (cont.)
"Required
W-field SSTNAM &nb (cont.)
sp; & (cont.)
nbsp; 20 &nb (cont.)
sp; W "Optional
In addition, you must specify the W-Fld parameter for SSTATE as being "SSTNAM". This tells MAGEC that SSTNAM is the (cont.)
W-field for SSTATE. MAGEC will automatically place the description (in this case, the state name) into the W-field (cont.)
based upon the code (in this case, state abbreviation) entered into the T-field (in this case, (cont.)
SSTATE).
Also, you must specify the number of significant digits (SIG) left of the decimal point, and the number of decimal (cont.)
places (DEC), for any numeric fields. For the SZIP field there are 5 digits left, and no digits right of the decimal (cont.)
point.
We have arbitrarily specified that each of the variables will be a Required field. That means that MAGEC will issue an (cont.)
error message to the operator if it is left blank when doing add or change operations. If a field is optional, MAGEC (cont.)
will appropriately default it to either spaces or zeros on the database if it is left blank.
You should us an unprotect field attribute for the city name, state code, and zip code variables; use skip-protect attributes for the other four fields.
| ```
** DO THIS:
Do the MSKCRE function by pressing PF10 from the MSKDEF screen, then
re-submit MMPCREAT to re-generate and compile the application.
```**
##
Demonstrate Table Features
Once you have achieved a clean compile, which should be in the first try unless you made an error somewhere along the (cont.)
line, you are ready to test. In the PC environment it is not necessary to issue any NEW COPY command, but on a (cont.)
mainframe, it is. For more detail reagrding this, refer to the discussion in the "Application Developer" tutorial (cont.)
regarding "New Copy of MMP" which is near Figure 15 in that section.
| ```
** DO THIS:
Do a NEW COPY, as appropriate
```**
You should now be able to use the VACCHG function to try to update an employee's vacation data. The new city, state, (cont.)
and zip fields should be on the screen. If the data is missing (i.e. blanks) you should receive error messages, such (cont.)
as:
Required Data Not Entered
Warning! Bad Data on File
You can type into the city, state, and zip fields to update the data on file, thereby correcting the errors noted.
If you enter a valid state or province abbreviation (that is, one which is defined in Table #003), the appropriate (cont.)
state name will appear on the screen in the W-field. If you enter an invalid abbreviation, you will receive an error (cont.)
message, as:
Invalid State/Province Code
If you point the cursor into the State Code field (SSTATE) and press PF2, the low-level Help key, you will receive (cont.)
field-level help for that screen field. This is much like the field-level help for any other screen field, except that (cont.)
there will be a message telling you that you can press PF8 to list the table of valid values (table #003, the State / (cont.)
Province Code Table). If you press PF8 you will receive the first page of valid state codes, subsequently pressing PF8 (cont.)
will page forward, PF7 pages backward.
When you have a list of state codes displayed on the screen, you can position the cursor down to the line on which the (cont.)
desired code appears (i.e. Texas) and press ENTER. MAGEC will then copy the code from the table into the screen field (cont.)
from which you pressed PF2. The screen will return to the Vacation screen, but the selected code will be filled into it (cont.)
automatically (i.e =. TX will be in the State Code field). This eliminates the need for your operators to memorize (cont.)
lists of codes.
When the code is copied from the table into your screen field, as described above, you will see a message displayed in (cont.)
SCOMPL saying that a code was copied from the table onto your screen. This does not update the file, it merely places (cont.)
the code into the screen field. You can modify it, or any other screen field's data, then press ENTER to update the (cont.)
record on the database.
##
Table Maintenance
Table #003 is provided with MAGEC when the system is initially installed. Table #003 is used for the tutorial projects (cont.)
and as a demonstration of how Lookup Tables work. It can also be used by any of your own applications to validate state (cont.)
or province codes.
Any MAGEC Lookup Table can be used by any number of applications. You can modify any Lookup Table using the built-in online functions provided with MAGEC.
Tables are identified by a 3-digit number, 001 through 999. The numbers 200 through 255 are reserved for use by the MAGEC software.
To display any given MAGEC table you can use the online command:
TBLLST nnn
where nnn is the 3-digit table number.
To alter any entry in a table you can use the command:
TBLCHG nnn/eeeeeee
where "nnn" is the 3-digit table number and "eeeeee" is the code (up to 16 characters long).
Similarly, you can add an entry to a table using the command:
TBLADD nnn/eeeeee
or you can delete any entry using:
TBLDEL nnn/eeeeee
If you prefer a batch hardcopy listing of any given table, or of several tables, you can use the batch utility program, (cont.)
TBLLIST. Refer to the "Offline Utilities" chapter of your *Programmer's Reference Guide* for details regarding (cont.)
TBLLIST.
Now, let's look at the display of the State / Province Table.
| ```
** DO THIS:
Enter the command: TBLLST 003, press ENTER.
```**
For details regarding how to define your own tables, refer to the "Database Administration" chapter of your *Programmer's Reference Guide*.
For details on how to produce a Where-Used report for any table, refer to the "Offline Utilities" section of your *Programmer's Reference* manual under the topic "MAGECLBR".
#
Project 6
##
Generating Pop-Up Window Programs
**
NOTE:
**
In this project we will demonstrate another way that you could have added the capability for the operator to update and (cont.)
see the city, state, and zip code information. Rather then placing it on the VACxxx screen (MSK600), as we just did in (cont.)
Project 5, we could generate another program which uses a miniature screen, approximately one-fourth the size of the (cont.)
large full-screen display. We could have shown the city, state, and zip code data in that smaller screen and we could (cont.)
have "CALL"ed the small screen program from MMP600, effectively popping up a window. When the operator is finished (cont.)
looking at or updating the data in the small window, he/she can return to the full-screen as it was left by merely (cont.)
pressing PF3.
A pop-up window program is very much like any other program except that it uses a smaller screen area and it does not (cont.)
erase the data previously on the screen when it is invoked. The small window is superimposed on the larger screen (cont.)
"behind" it. pop-up window programs can do the same kinds of functions as can full-screen programs. The standard set of (cont.)
nine functions is available to select from, plus any custom functions can be added.
A pop-up window program and screen are not limited to being invoked by just one particular calling program, but rather, (cont.)
they can be invoked from any number of other programs. The most usual way to invoke a pop-up window program is via the (cont.)
MAGEC Attach / Detach facility discussed in Appendix R of this section; however, you can invoke a pop-up window program (cont.)
via the Fetch (discussed in Appendix B), or just by typing one of its Function Codes into SFUNCT on the screen, since (cont.)
they are really just ordinary programs like any other. Similarly, the Attach / Detach facility is most often used to (cont.)
next: cstm13.md.txt