________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
________________________________________________________________________________
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 14 -- Data Item Change Screen
After you have put your finishing touches on the dictionary definitions for the Data Items it is time to generate a new, MAGEC-standard COBOL definition. You use the DITGEN function to do that.
| ```
** DO THIS:
Key in the command: DITGEN VAD01 and press ENTER.
```**
The screen will look like the figure shown below.
| ```
** DO THIS:
Verify that you spelled VAD01 right, press PF14 (Shift-F4 on PC) to continue.
```**
**
NOTE:
**
If the access method specified in the DCL definition (first step in the data definition process) had been either SQL or (cont.)
DB2, the DITGEN function would generate both the standard Cobol data definition copybook, plus an SQL host variable (cont.)
definition copybook, plus the code to move data from the host variables to the Cobol definition and vice-versa. When (cont.)
you generate an application accessing this data, MAGEC will automatically include these copybooks where (cont.)
appropriate.
**
NOTE:
**
As of Release 3.0 of MAGEC the DITGEN function has the added task of generating the ASCII / EBCDIC translation (cont.)
parameters for the Element. These parameters control the conversion of data which is being read or written to another (cont.)
computer in a network when the two computers use dissimilar coding schemes. As it attempts to build these parameters, (cont.)
which will be stored on the ELT record for the Element, it senses inconsistencies resulting from redefinitions or (cont.)
incorrect lengths for group items. DITGEN will stop generation and display an error message when such inconsistencies (cont.)
are detected. If you wish to ignore them and force DITGEN to proceed and generate the normal Cobol definition without (cont.)
producing correct and valid translation parameters, press PF5 instead of PF14.
We recommend that you not ignore any errors noted, even if you do not anticipate needing ASCII / EBCDIC translation. (cont.)
You should go back to the DIT records and correct the errors. The purpose for PF5 is to enable you to revert to a less (cont.)
thorough validation process which is identical to that employed in prior releases of MAGEC.
| ```
**
DITGEN VAD01
=================================================================================
_________________________________________________________________________________
To Generate (or Re-Generate) the CopyBook
Press PF14 (or PF5 to ignore certain errors)
(you must have Excl. Ctl. of the Element)
Generated CopyBook will OVERLAY the
old CopyBook - if one exists
Member Name will be
VAD01-C
```**
**
NOTE:
**
The DITGEN function asks you to press PF14 to confirm that you really do want to re-generate the copybook. It also (cont.)
shows ou the name of the copybook which wil be catalogued. If the access method is SQL, or DB2, other members will also (cont.)
be generated.
Figure 15 -- DITGEN Screen
MAGEC will generate the Cobol copybook and catalogue it to the MAGEC library for use in any program which accesses the (cont.)
VAD01 Element. It will display the new copybook to you for verification. You do not need to do anything to the (cont.)
generated copybook.
Notice that the key field is highlighted with a marker in column 1 through 6. This signifies that that field name (cont.)
matches the one specified on the KYF (key definition) as the Cobol Name for the key. The key field should never be a (cont.)
numeric (PIC 9) type field and should be the same length as the specified key length (on the KYF). If MAGEC had sensed (cont.)
a discrepency as it was generating the Cobol copybook, it would have issued an error message
*it would have still generated the copybook, though.* The error message would be merely a warning. You could always review the specifications for the key using the command:
KYFSEE VADK1
You can now exit MAGEC in preparation to submit the batch jobstreams to create and initialize the new file.
| ```
** DO THIS:
Press PF15 to exit MAGEC.
```**
| ```
**
LBRNXT VAD01-C//001
SEARCH ARG: ..................................................................
Password: M A G E C VAD01-C page
LIBRARY MEMBER (001)
TAB Option: ON
....+..;10.;..+;..20....+...30....+...40...;+...50....+...60....+...70..
* * * THIS COPYBOOK GENERATED BY "DITGEN" 01
* * * FROM TEST VERSION 93/11/25 11:46:43 02
* * * PRIMARY KEY FIELD IS VAD01-KEY 03
04 VAD01-ELEMENT. PIC X(00198). 04
04 FILLER REDEFINES VAD01-ELEMENT. 05
KEY==> 05 VAD01-KEY. 06
06 VAD01-EMPNUM PIC 9(09). 07
06 VAD01-FILLER PIC X(00009). 08
05 VAD01-DATE-HIRED. 09
06 VAD01-DATE-HIRED-YY PIC XX. 10
06 VAD01-DATE-HIRED-MM PIC XX. 11
06 VAD01-DATE-HIRED-DD PIC XX. 12
05 VAD01-EARNED-VACATION PIC S9(05)V9(02) COMP-3. 13
05 VAD01-TAKEN-VACATION PIC S9(05)V9(02) COMP-3. 14
05 VAD01-EARNED-SICK-DAYS PIC S9(05)V9(02) COMP-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
```**
Figure 16 -- Copybook in Library
**
NOTE:
**
Now it is time to actually create and initialize your new file. If you are using a mainframe computer to do this (cont.)
project you may wish to skip this step since there is little new to be learned from it. On a PC it is very easy to (cont.)
create the file using the MAGINIT batch utility provided with MAGEC, therefore, you should go ahead and create (cont.)
it.
If you are using a mainframe
you must execute IDCAMS with the appropriate control cards to DEFINE a cluster. Then you can execute MAGINIT to (cont.)
initialize the file. Initialization is necesssary before you can access the file from CICS (or other TP Monitors). It (cont.)
consists of opening the file "for output", writing a record to it, closing the file and (optionally) re-opening the (cont.)
file and deleting the "initialization record".
The JCL to execute MAGINIT is shown in the "Offline Utilities" chapter. You simply specify the new file using the DD (cont.)
(or DLBL) for "NEWFILE". There are no control cards. If you are doing the project on a PC then you can simply execute (cont.)
MAGINIT to both create and initialize the new file. At the DOS prompt, key the command "MAGINIT". The program will ask (cont.)
you for the Data Class to be initialized, respond with "VAD" (excluding the quotes).
| ```
** DO THIS:
Execute IDCAMS, then Submit MAGINIT.
```**
If you are using MAGEC on a PC
with the Realia Cobol or Micro Focus Cobol compiler then the file MAGINIT.BAT is the jobstream you execute to both (cont.)
create and initialize your new file. This file can be found in your \MAGEC\JCL (for Realia) or \MAGMF\JCL (for Micro (cont.)
Focus) directory (depending on which Cobol compiler is installed)
| ```
** DO THIS:
At the DOS prompt type the command MAGINIT VAD.
```**
**
NOTE:
**
Appendix A of this tutorial tells you how to delete all of your work. You may wish to do the steps in Appendix A after you complete this project in order to clean up for the next student.
#
Database Utility
##
DBDITO
MAGEC includes a useful online utility program which allows you to do any database operation right from the screen. You (cont.)
can display data, update data, add data, and delete data. You can enter in either character or in hexadecimal format. (cont.)
Data is displayed in both formats simultaneously.
| ```
** DO THIS:
Return to MAGEC via the "TS01" command and log on (if necessary).
```**
Once in MAGEC you must log on again (if you are told to do so), then you can use the online DBDITO utility.
| ```
** DO THIS:
Key the command: DBDITO and press ENTER.
```**
The screen will look like the figure shown below.
You can press, the HELP key (PF1, F1 on a PC) for instructions on how to use the DBDITO function.
DBDITO is a very handy tool for debuggers, developers, and database administrators. It can help you in many ways:
It can be used to find and correct bad records on a file
It can be used to teach newcomers how the MAGEC database commands work
It can be used to test your new/altered file definitions
It can be used to create test data
It can be used to un-delete records (if they are pseudodeleted)
*In the wrong hands*, it can produce great damage. It is important that your security officer maintain tight control over access to this powerful function
**
NOTE:
**
Figure 17 (below) is shown for EBCDIC systems. If you are doing the project on an ASCII machine (i.e. IBM PC or PS/2) you will see different hexadecimal codes corresponding to the display characters.
The DBDITO display shows each display character with the hexadecimal value below it in vertical format. The SPACE character is X'40' in EBCDIC and it is X'20' in ASCII.
| ```
**
DBDITO ___________________________ M A G E C DATABASE UTILITY
CMD _____ FILE ___ KEY _____ RTN CDE DBID ___
ELEMENTS __________________________________________________
START RECORD DISPLAY AT ____
......................................................................
4444444444444444444444444444444444444444444444444444444444444444444444
0000000000000000000000000000000000000000000000000000000000000000000000
......................................................................
4444444444444444444444444444444444444444444444444444444444444444444444
0000000000000000000000000000000000000000000000000000000000000000000000
......................................................................
4444444444444444444444444444444444444444444444444444444444444444444444
0000000000000000000000000000000000000000000000000000000000000000000000
......................................................................
4444444444444444444444444444444444444444444444444444444444444444444444
0000000000000000000000000000000000000000000000000000000000000000000000
Press PF1 for Instructions
```**
Figure 17 -- DBDITO Screen
You can enter the MAGEC database commands right on the screen using DBDITO. You will see the results of the commands immediately.
| ```
** DO THIS:
Key in the LOCKY command as shown below, press ENTER.
```**
The LOCKY command does a generic key "start browse". The **key valu****e** will be taken from the "data area" of the screen (where character/hex is displayed over/under).
next: data06.md.txt