Use "TS01" to re-enter MAGEC.
```**
| ```
** DO THIS:
Log on as Employee# 18, Password: ALEE.
```**
Next we will look at the generated definitions online.
When MAGECLBR adds the DIT definitions from your input Cobol definition it must take defaults and make determinations (cont.)
regarding the attributes of each data item based upon the Cobol PICTURE clause alone. These default attributes will, in (cont.)
all cases, operate; however, they may not always produce the most aesthetically pleasing results.
It is a common practice for MAGEC users to first use the MAGECLBR utility to accomplish the "grunt work" and then to (cont.)
refine the DIT definitions online using the "DITCHG" function. This enables them to specify such things as a Prompt (cont.)
(heading) literal and data formatting and editing rules to produce better looking screens and reports with a minimum of (cont.)
effort by the application developers.
| ```
** DO THIS:
Key the command: DITLST VAD01, press ENTER.
```**
The screen will return to you with the Data Items for VAD01 listed and showing the level numbers and PICTURE's. You can (cont.)
now cursor-select any item by moving the cursor down to it's line and pressing ENTER to see it (or PF4 if you wish to (cont.)
change it).
Notice that the Cobol level numbers have been adjusted to comply with the MAGEC standard.
| ```
**
DITLST VAD01 END of LIST PF5=Restart/PF7=Backward
M A G E C DATA ITEM LIST
seq# Lvl . . . Data-Name . . . . . . . PICTURE Domain Name
000010 04 VAD01 ELEMENT X(00198)
000020 05 VAD01 KEY X(00018)
000030 06 VAD01 EMPNUM 9(09)
000040 06 VAD01 FILLER X(00009)
000050 05 VAD01 DATE-HIRED X(00006)
000060 05 VAD01 EARNED-VACATION S9(05)V9(02) COMP-3
000070 05 VAD01 TAKEN-VACATION S9(05)V9(02) COMP-3
000080 05 VAD01 EARNED-SICK-DAYS S9(05)V9(02) COMP-3
000090 05 VAD01 TAKEN-SICK-DAYS S9(05)V9(02) COMP-3
000100 05 VAD01 EARNED-COMP-DAYS S9(05)V9(02) COMP-3
000110 05 VAD01 TAKEN-COMP-DAYS S9(05)V9(02) COMP-3
000120 05 VAD01 COMMENT X(00050)
++++ 12 Records Scanned, 12 Displayed so far - Page 1 ++++
KEY 1 = ELT / MODE / SEQ# Press PF13 for Hardcopy
You may Position the CURSOR on an item and Press ENTER to "SEE" it
(Browsing Forward) or Press PF4 to "CHG" it
```**
**
NOTE:
**
The DITLST display is a typical browse, except that it shows DIT records for only the specified Element, stopping when (cont.)
it reaches the last DIT for that Element. As a typical browse, it supports cursor-selection to transfer to a SEE or a (cont.)
CHG function for the selected item.
Figure 11 -- DITLST Screen
We would now like to modify the specifications for the DATE-HIRED data item. It was defined as a simple PIC X(6) field (cont.)
by MAGECLBR, we will alter that specification to tell MAGEC that this is actually a YYMMDD date field which we wish to (cont.)
have displayed on the screen(s) and report(s) in the format MM/DD/YY. This will also tell MAGEC to automatically (cont.)
validate any data entered into the screen(s) to update this field to ensure that it is a valid date. It will also tell (cont.)
MAGEC to automatically present to the application program(s) the Julian equivalent and Day-of-Week code for the (cont.)
Gregorian date on the screen. These help the applications programmers to add their own custom editing more easily, i.e. (cont.)
to verify that the date is not a weekend day, etc.
Cursor-select the DATE-HIRED field for update.
| ```
** DO THIS:
Position the cursor to the line where VAD01 DATE-HIRED is listed and press PF4.
```**
The screen will now show all the specifications for the selected field. You can overtype any of the specs and press ENTER to change them.
**
NOTE:
**
By positioning the cursor to a line on the DITLST screen, then pressing PF4, you will have selected that item for a CHG (cont.)
function. If instead of PF4, ENTER was pressed, then you will have selected that item for viewing, which is a SEE (cont.)
function. To then alter data on the screen you would need to key "CHG" over the "SEE" of "DITSEE" in the function area (cont.)
of the screen.
| ```
**
DITCHG VAD01/T/000050
M A G E C D a t a I t e m
Element MAGEC Vacation Dummy data Field Seq#: 000050 Mode T
Level: Data Name: Sig Dec Sign: Usage:
05 VAD01 DATE-HIRED PIC 9( 00 )V9( 00 )
EditType: U Tbl: 000 Req: Lgth: PIC X( 00006 ) Just:
Occurs: 00000 Depending On:
Redefines: 88-Val/Pattern:
Prompt: Domain Name:
DataBase Identifier:
Data Item Narrative: Displacement / Length:
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
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 Press PF24 for Pop-up Short List
```**
Figure 12 -- DITCHG Screen
Change the **Edit Type** as shown to specify this field as being a date. An Edit Type of "M" indicates that it is to be (cont.)
displayed on the screen and on reports in the MM/DD/YY format, it is stored on the file in the YYMMDD (cont.)
format.
Also, enter a **Prompt** for the field. The prompt will be used as the "heading" for this field on reports and as the (cont.)
screen prompt for online displays and updates. If you do not specify a Prompt then MAGEC will generate one (as best it (cont.)
can) using the COBOL dataname as its basis.
| ```
** DO THIS:
Key in the Edit Type, Prompt,and Narrative as shown, press ENTER.
```**
**Level** is the Cobol level number of this item.
**Data Name** is the Cobol dataname, a prefix of the element name is forced.
**Sign **is "S" for signed numeric, blank for unsigned and non-numeric.
**SIG** is the number of significant digits left of the decimal point. Must be "00" for alphanumeric items, may be "02" pr "04" for dates
signifying number of digits in year (88 versus 1988).
**Dec** is the number of decimal places, must be "00" for alphanumeric items. For dates this specifies the number of years old an acceptable date may be.
**Comp **is "P" for packed decimal data, "B" for binary data, blank for non-numeric or zoned decimal data.
**Edit Type** is the MAGEC type code as defined in the *Programmer's Reference Guide*.
**Tbl **is the MAGEC lookup table number, valid for Edit Type "T" items only, otherwise must be zero.
**Req** is "R" for a required item, "O" for an optional item.
**Lgth** is the field's length in bytes (calculated automatically for numeric items).
**Just **is "L" for left justified, "R" for right justified, default is left justified.
**Redefines** is the dataname (standard prefix omitted) of the data item which this item redefines, blank if not applicable.
**88-Val/Pattern** is the condition value (if this is an 88 level item), or the edit pattern if this is an Edit Type "P" or "#" item.
**Domain Name** is the name (up-to 20 characters long) of the domain to which this data item belongs. Leave blank if (cont.)
the data item does not belong to any domain. Domains are discussed later in this tutorial and in the "Database (cont.)
Administration" chapter of your "Programmer's Reference" book..
**DataBase Identifier** is the up-to 20-character ID used by the SQL database. You can leave this blank if not using SQL, it will be ignored.
**Data Item Narrative** is the 8-line descriptive text which will be presented to the application user when he or she (cont.)
requests field-level HELP by pointing to a screen field and pressing the PF2 key on an application accessing this data (cont.)
item.
**Displacement / Length** is displayed for your information only, you cannot enter into these fields. They show the (cont.)
displacement, relative to zero within the Element, and the number of bytes that this field occupies.
| ```
**
DITCHG VAD01/T/000050
M A G E C D a t a I t e m
Element MAGEC Vacation Dummy data Field Seq#: 000050 Mode T
Level: Data Name: Sig Dec Sign: Usage:
05 VAD01 DATE-HIRED PIC 9( 00 )V9( 00 )
EditType: m Tbl: 000 Req: Lgth: PIC X( 00006 ) Just:
Occurs: 00000 Depending On:
Redefines: 88-Val/Pattern:
Prompt: Hire Date Domain Name: ____________________
DataBase Identifier:
Data Item Narrative: Displacement / Length:
This is the actual date that the employee was hired. It should always be_______
accurate if at all possible. Refer to the personnel records if necessary_______
to be sure._____________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
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 Press PF24 for Pop-up Short List
```**
Figure 13 -- Data Item Definition Screen
You should specify PROMPT's for the other fields, as well. This is not mandatory, but it is much nicer. A rule of thumb (cont.)
might be to specify a PROMPT which is approximately the same length as the field. That will avoid wasted space on (cont.)
reports since MAGEC must allow room for the larger of the field or its heading. Don't get too cryptic, (cont.)
though.
You might also wish to alter the Edit Types for the numeric fields and for the Employee Number (EMPNUM) field to improve their appearance on the screens and reports.
You could refer to the *Programmer's Reference Guide* for a full description of the Edit Types and their meanings. For this project we recommend the following:
For the numeric fields (not including EMPNUM) use the Edit Type "-" (the minus sign). This tells MAGEC that you wish leading zeros to be suppressed and that the value may be negative.
For the EMPNUM data item we recommend that you use the Edit Type of "#" (pound sign). This tells MAGEC that it is a (cont.)
numeric, pattern-edited field. The edit pattern is entered into the "Pattern" (also named "Initial Value" prior to (cont.)
Release 2.0 of MAGEC). We suggest the Pattern of "999-99-9999" since the Employee Number is usually the same as Social (cont.)
Security Number. This will tell MAGEC to format this 9-digit number onto screens and reports by inserting the dashes. (cont.)
There are numerous other Patterns you could devise which might be equally valid.
In order to get full benefit from the field-level HELP capabilities built into every online application, we recommend (cont.)
that you enter a narrative for each DIT (with the possible exception of group items which will never be referenced and (cont.)
FILLER's).
| ```
** DO THIS:
Scroll down to the Figure below.
```**
| ```
**
DITCHG VAD01/T/000050 Data UPDATED on Database
M A G E C D a t a I t e m
Element MAGEC Vacation Dummy data Field Seq#: 000050 Mode T
Level: Data Name: Sig Dec Sign: Usage:
05 VAD01 DATE-HIRED PIC 9( 02 )V9( 00 )
EditType: M Tbl: 000 Req: O Lgth: PIC X( 00006 ) Just: L
Occurs: 00000 Depending On:
Redefines: 88-Val/Pattern:
Prompt: Domain Name: ____________________
DataBase Identifier:
Data Item Narrative: Displacement / Length:
This is the actual date that the employee was hired. It should always be_______
accurate if at all possible. Refer to the personnel records if necessary_______
to be sure._____________________________________________________________________
________________________________________________________________________________
next: data05.md.txt