convention.
**
NOTE:
**
A suffix of "00" specifically means to MAGEC that this Element is an audit stamp. MAGEC assumes that it is always to be 36 bytes in length. Having it defined otherwise will cause problems.
The Audit Stamp is useful for detecting fraudulent accesses and for investigating errors. You can often determine which (cont.)
program is placing incorrect values into the database by inspecting the audit stamps of the records containing (cont.)
incorrect data.
An Audit Stamp must always be defined as a 36-byte Element (if you have specified that this Data Class has an Audit Stamp in the DCL definition).
**
NOTE:
**
The Audit Stamp is an *optional* feature of MAGEC which you may specify for some Data Classes, and not for others. When (cont.)
defining your pre-existing files to MAGEC, they need not be re-formatted to accommodate an Audit Stamp; just specify (cont.)
(on the DCL definition) that they do not have an Audit Stamp and then do not define a "00" element. Remember, you can (cont.)
access your existing files exactly as they are. Pre-existing programs can continue to access the same files with no (cont.)
changes.
| ```
** DO THIS:
Key in the command: ELTADD VAD00, press ENTER.
```**
The screen which is displayed now should look like the one shown in Figure 07. Now see below for instructions to fill in this screen.
**
NOTE:
**
In this tutorial you may have noticed that the physical record length (see DCLADD screen) is 270 bytes, while the two (cont.)
elements we are defining (VAD00 is 36 bytes, VAD01 is 198 bytes) add up to only 234 bytes. This leaves 36 bytes of the (cont.)
physical record undefined. This is not an error! It is a legitimate practice to allow for anticipated (cont.)
expansion.
We could later on define another element, say VAD02, which describes that unused 36-byte portion of the record. Doing (cont.)
so would not require us to alter, or even re-compile the programs which access VAD01 and/or VAD00. This is one aspect (cont.)
of how MAGEC provides data independence for our applications. Of course, this would also work if we had not left unused (cont.)
space, perhaps by having defined the physical record length as 234 bytes originally. Then, however, we would have to (cont.)
physically unload the data file, re-define the file to VSAM (or whichever access method is being used), reload the data (cont.)
to the newly defined (longer record length) file. We still would not need to touch any pre-existing programs since the (cont.)
programs never knew the record length in the first place.
MAGEC's I/O module automatically initializes any undefined areas of the physical record to spaces whenever you add (cont.)
records to the file; therefore, the undefined portion will have a predictable content if/when you decide to put it to (cont.)
use.
| ```
**
ELTADD VAD00
M A G E C Data Element Definition
Data Dictionary Maintenance
Element (Segment)= VAD00 data-class
..................................
Description: __________________________________
test production
Displacement: _____ _____
Length: _____ _____
DEVELOPER AUTH. - BATCH : _
DEVELOPER AUTH. - ONLINE: _
Employee having temporary Exclusive Control: _________
BOBBIE LLOYD
```**
Figure 07 -- Element Definition Screen
This Element definition is similar to the one you just did for Element VAD01.
| ```
** DO THIS:
Key in the specs as shown below, press ENTER.
```**
The Audit Stamp [in this case] is the first 36 bytes of the physical record. MAGEC does not require it to be the (cont.)
*first* 36 bytes, but most users define it that way for consistency. It might be a good idea if you followed that same (cont.)
procedure when defining files with Audit Stamps.
The Audit Stamp Element **must** be defined if the DCL definition specifies that this Data Class has an Audit Stamp, (cont.)
otherwise you will likely get a DB Error 99 (DB99) or Error 22 (DB22) at run-time when accessing this Data (cont.)
Class.
It is not necessary for you to define any Data Items (DIT's) for the Audit Stamp Element; MAGEC will use the predefined (cont.)
standard definition for it. All Audit Stamps have an identical definition. It is defined in the library member ELT00-C (cont.)
on the MAGEC library. To look at it you can enter the command:
LBRSEE ELT00-C
| ```
**
ELTADD VAD00 Enter data to be ADDED
M A G E C Data Element Definition
Data Dictionary Maintenance
Element (Segment)= VAD00 data-class
..................................
Description: MAGEC Audit Stamp_________________
test production
Displacement: 0____ 0____
Length: 36___ 36___
DEVELOPER AUTH. - BATCH : 0
DEVELOPER AUTH. - ONLINE: 0
Employee having temporary Exclusive Control: 18_______
```**
Figure 08 -- Element Definition Screen
To avoid unnecessary I/O overhead ordinarily associated with dictionary-driven systems, MAGEC loads compressed images (cont.)
of the dictionary data associated with file definitions and security into main memory. It uses highly optimized search (cont.)
algorithms to access that data. The data is originally loaded into memory when your online system is first brought up, (cont.)
or whenever the first transaction to MAGEC is sensed. You can cause MAGEC to reload this data dynamically in order to (cont.)
put new or changed definitions into effect immediately.
In order to tell MAGEC to refresh its in-memory images of the data definitions from the ones stored on the dictionary files, you must use the **LOAD command.
| ```
** DO THIS:
Key in the command: **LOAD as shown, press ENTER.
```**
You can key in the command "**LOAD" from any screen. You do not need to first press the CLEAR key or blank out the other data on the screen, it will be ignored by the **LOAD program.
Next we must define the Data Items (DIT's) for the VAD01 Element. We will first use the batch MAGECLBR utility to (cont.)
populate the dictionary from an "old" COBOL definition, then we will use the online DITxxx functions to put the (cont.)
finishing touches on the definitions.
Exit MAGEC and go into your text editor.
| ```
** DO THIS:
Press PF15 to exit MAGEC.
```**
| ```
**
**LOAD Data ADDED to Database
M A G E C Data Element Definition
Data Dictionary Maintenance
Element (Segment)= VAD00 data-class
MAGEC Vacation Dummy File
Description: MAGEC Audit Stamp
test production
Displacement: 00000 00000
Length: 00036 00036
DEVELOPER AUTH. - BATCH : 0
DEVELOPER AUTH. - ONLINE: 0
Employee having temporary Exclusive Control: 18
TO MAKE YOUR CHANGE EFFECTIVE IMMEDIATELY DO NOT FORGET **LOAD !!!
```**
Figure 09 -- **LOAD Command
#
Data Item Definition
##
MAGECLBR
Refer to the "Offline Utilities" chapter of your MAGEC manual for the proper JCL with which to execute MAGECLBR. JCL (cont.)
varies from one operating environment to another; however, the control card formats for MAGECLBR are the same in all (cont.)
environments.
If you are doing this project on a PC with the Realia, or Micro Focus Cobol version of MAGEC then you will find the (cont.)
"JCL" in the member named \MAGxx\JCL\MAGLBREX.BAT and the control cards (and data cards) will be placed into the (cont.)
\MAGxx\MAGECLBR.RDR member. You can access either of these using any PC editor. Many MAGEC users like the PC (cont.)
implementations of SPF which are available with the MAGEC system. In the above PC direcory names, \MAGxx stands for (cont.)
\MAGEC or \MAGMF, depending on which Cobol compiler is in use.
| ```
** DO THIS:
Key the control cards as shown below and submit.
```**
**
NOTE:
**
The ****TRM**** control card tells MAGECLBR to trim off the prefix "VDF-" from the datanames. MAGECLBR will automatically add a prefix of "VAD01-" as it adds the definitions to the dictionary.
The first item is named "ELEMENT", which is another MAGEC standard.
If you are using one of your own old COBOL definitions as input to MAGECLBR you should change the name of the first (group) item to "ELEMENT".
If your Cobol level numbers begin with numbers less than 04, MAGECLBR will bump the COBOL level numbers up so that they (cont.)
start with level 04 and above. This is because the data definitions will be included into the TWA under a level-03 item (cont.)
(TWA-DB-DATA).
The date field is defined as simply X(6). Later we will tell MAGEC that this field is a date by setting the "Edit Type", MAGEC will then generate the appropriate breakdown (YY, MM, DD) automatically.
**
**
**
NOTE:
**
The **-MAGECDEL** card is to delete any pre-existing DIT definitions for the VAD01 Element (if they exist). If they do (cont.)
not exist [as in the first time you do this project on a newly installed system] then you should omit the **-MAGECDEL** (cont.)
control card.
The Cobol definitions in the example (Figure 10) are in standard Cobol format and indented to Cobol norms (column 8, (cont.)
column 12, etc.). Virtually all valid Cobol definitions are acceptable; however, level-66 and level-77 items are not (cont.)
supported. Level-88 is supported. You should always review the generated definitions online to verify that they are (cont.)
correct and to add finishing touches (such as: Domain definitions, patterns edits, table validations, narrative (cont.)
descriptions, etc.). Always **check the "printout"** for error or warning messages, as well.
-MAGECDEL DIT VAD01
**-MAGECADD DIT VAD01
**TRM**VDF-
01 VDF-ELEMENT.
02 VDF-KEY.
03 VDF-EMPNUM PIC 9(9).
03 FILLER PIC X(9).
02 VDF-DATE-HIRED PIC X(6).
02 VDF-EARNED-VACATION PIC S9(05)V9(02) COMP-3.
02 VDF-TAKEN-VACATION PIC S9(05)V9(02) COMP-3.
02 VDF-EARNED-SICK-DAYS PIC S9(05)V9(02) COMP-3.
02 VDF-TAKEN-SICK-DAYS PIC S9(05)V9(02) COMP-3.
02 VDF-EARNED-COMP-DAYS PIC S9(05)V9(02) COMP-3.
02 VDF-TAKEN-COMP-DAYS PIC S9(05)V9(02) COMP-3.
02 VDF-COMMENT PIC X(00050) OCCURS 3 TIMES.
NOTE:
**
The -MAGECDEL card is needed only if there are existing DIT's for this element. It should not be used if there are none.
Figure 10 -- MAGECLBR Control Cards
When you submit the MAGLBREX jobstream, the MAGECLBR program will read the input Cobol definition and will generate (cont.)
Data Item definitions (DIT's) into the dictionary for you. This is faster than manually entering each one online, (cont.)
though you could accomplish the same thing that way.
To submit MAGLBREX on a mainframe insert the control card(s) and data cards into the jobstream (named MAGLBREX) and (cont.)
submit it. On a PC the control cards must be placed into a text file (usually named \MAGxx\MAGECLBR.RDR), the SET (cont.)
SYS006 command in the .BAT file named MAGECLBR.BAT must specify the input file name (\MAGxx\MAGECLBR.RDR) and you must (cont.)
type the command "MAGLBREX" at the DOS prompt, or select the MAGECLBR icon from your Windows or OS/2 control panel. You (cont.)
can refer to the "Offline Utilities" chapter of the *Programmer's Reference Guide* for more (cont.)
information.
You should check the output listing from MAGECLBR to be sure that it completed correctly. If it did not, correct any errors and rerun.
To "get back into MAGEC":
| ```
** DO THIS:
next: data04.md.txt