Copies of this guide should be distributed to:
This book is not intended to replace the online documentation but to augment it. Though there is some overlap, this book takes a grander, more general perspective while the online documentation is usually aimed at the particular Function the operator is dealing with at a given time. You can invoke the online HELP facility from any online screen shown in this book by pressing the HELP key (PF1); field-level HELP is also available by positioning the cursor to the field in question and pressing the field-level HELP key (PF2).
This guide is written assuming that the reader is familiar with the overall MAGEC philosophy. It presumes that you understand how the "standard set of nine" Functions work and that you are familiar with the standard screen formats of MAGEC. We suggest that you first read the MAGEC Application User's Guide, if you have not already.
MAGEC applications normally do all their file I/O via the I/O module (MAGECIO). They tell MAGECIO what they want to do and to what Data Class (usually means "file") by moving parameters into a Request Area and PERFORMing the CALL routine:
MAGDBMS is an old entry point into MAGECIO used for compatibility with older releases of MAGEC. MAGECIO provides a variety of services for the application programs (MMP's). It, of course, issues the appropriate TP monitor command to accomplish the requested I/O. It checks for bad return codes from the Access Method or Database Management System (DBMS). If a return code indicates that an error occurred which could not be corrected by the application MMP or user then it issues an appropriate error message and aborts the task with a dump. An example of this type of error is a hardware failure. In another section of this chapter, Appendix A, Error Codes and Messages, there is a list of possible errors.
If the file being accessed is defined according to recommended MAGEC standards then it will probably have an Audit Stamp. An Audit Stamp is a 36-byte portion of the record (defined as a separate Element) which is used by MAGECIO to record Who, Where, and When this record was last updated/added. MAGECIO maintains the Audit Stamp data on every file update. It has proven a valuable aid for security and debugging.
MAGECIO provides the application programs a high degree of "transparency" or "portability" from any one of the supported access methods or DBMS's to any other. For example, an application may be developed to access a file which is VSAM KSDS at the time of development but which is later converted to Datacom DB. The program need not be changed or even recompiled when the file is converted. Simply altering the appropriate parameter in the MAGEC Dictionary via the online Functions provided will indicate that MAGECIO is to now access the file using the new "access method". In the rare case where an application MMP must access a file type which is not supported by MAGECIO, then it (the Cobol MMP) may use the standard TP monitor facilities (such as: EXEC CICS ...) to do so. In that case the file need not even be defined to MAGEC's Repository.
The valid access methods to use with MAGEC applications are:
In an IBM PC (or compatible) environment MAGECIO supports VSAM and Datacom DB files. Actually both are a simulation of the mainframe access methods and both work identically to one another and to the mainframe. One major difference is in how you create and initialize new files on the PC. The MAGINIT jobstream both creates and initializes new files, eliminating the need for the IDCAMS or DDCFMNT utilities used on the mainframe. PC MAGEC also eliminates the need for the DFHFCT or WESTIFG macros or "access tables" used on the mainframe to define the files to the TP monitor.
Under CICS or WESTI, MAGECIO supports VSAM, ISAM, BDAM, and Datacom DB files. The application MMP's need not even be aware of which access method is employed for a given file since MAGECIO will interrogate the Dictionary definitions to determine how to access each file. The Dictionary definitions are loaded into main memory at system start-up time in order to eliminate the run-time overhead of accessing the Dictionary files. A special Function Code is provided for database administrators and security officers to dynamically reload the data into main memory if changes have been made. The Function Code is:
The **LOAD Function requires no key value and any data in SKEY will be ignored and discarded. The data which is loaded includes:
NOTE:
When the loading is completed a message will be returned which shows the number of Function Codes (FCD's) in the system. While the loading operation is in progress MAGEC will be "quiesced". If an operator attempts to enter any Function Code he/she will receive the message:
The operator may wait and re-press the ENTER (or other) key and the transaction will be processed as normal (if the loading operation is now completed).
Datacom DB files to be accessed via MAGECIO must be defined in a "file table" as described in the DBMS's manuals. They must also be defined to MAGEC's Dictionary. The Data Class definition is always required (on the DCL file), the KYF definition is also required. The ELT definitions are not required since the DBMS's Element definitions will be used; however, the ELT definitions are required in order to permit entry of the Data Item (DIT) definitions which are, in turn, required for a number of other automated features.
VSAM files to be accessed via MAGECIO must be defined via the standard IDCAMS utility and via the CICS FCT or WESTI WESTIFG file definitions. The online start-up JCL must also include the appropriate DD or DLBL statements for the VSAM files. The DD name (or DLBL name) must be entered into the file's KYF definition, spelled exactly as it is in the FCT or WESTIFG and in the JCL.
MAGEC supports only VSAM files (KSDS, RRDS, and ESDS) in the VM/CMS environment. The standard AMSERV utility is used to create new files and the MAGINIT utility will initialize them once they are created.
MAGEC provides a utility program that makes it easy to initialize new VSAM files that are not loaded using the standard IDCAMS REPRO utility. The MAGEC offline utility jobstream MAGINIT allows you to initialize a new VSAM file, once it is defined to a VSAM catalog. This means there is no longer any need for you to write a one-time program to initialize your files before they can be used by your application programs. For additional details on executing MAGINIT, refer to the MAGEC "Offline Utilities" chapter.
NOTE:
Prerequisite Reading
Types of Files Supported
Defining File to TP Monitor
PC MAGEC
CICS and WESTI
VM/CMS
Initializing VSAM Files
Defining the Data Class
DCLxxx yyy |
The combination of the Audit Stamp with the "pseudodelete" (Real Delete = N) option and the maintenance of a history tape might enable you to:
applies to Datacom DB files and should be left as 000 for others.
is the physical size specified in the IDCAMS or database creation parameter.
defines what type of file this is. Valid types include:
Code MeaningNE =
specifies the name of the gateway (or host) machine which is used to access this Data Class. If this is blank or set to LOCAL, MAGECIO assumes that this data is accessed via ordinary local access. If a gateway name is specified here, all accesses to this Data Class's records is done via issuing a TCP/IP request to the named machine, which will process the I/O command requested and return the results. If MAGEC's TCP/IP networking feature is not installed you should always specify LOCAL (or blanks) here. Gateway Names are defined in MAGEC Lookup Table #248.
Remember, use the **LOAD Function to tell MAGEC to reload its main-memory images of the Data Class (and other) definitions when you are ready for them to take effect.
For Data Classes having an access method of Datacom specified on their DCL record, MAGEC supports alias names for keys and elements.
The screen depictions on the following pages do not include several special screen fields which will appear only if the access method is Datacom. These additional screen fields allow you to specify to MAGEC the actual Datacom/DB names for keys and elements. If the name given to MAGEC is the same as the name used in the Datacom/DB definitions then it is not necessary to enter anything into these special fields; however, if they are different you must enter the actual CA Datacom names into the screen fields when they appear.
Many MAGEC users who also use Datacom/DB implemented both products simultaneously, or implemented MAGEC first, then Datacom. In these cases they normally will have adopted MAGEC's naming standards universally and will have no need for alias names. Some users; however, already had a large number of Datacom databases in place at the time they implemented MAGEC and may not have adhered to MAGEC's naming conventions. These users will have need for the alias names.
MAGEC requires that the primary key (master key) be named as: xxxK1 (where xxx = Data Class name.) Alternate keys (subordinate keys) must be named xxxK2, xxxK3, et cetera. If your Datacom key names are different from this standard you must enter the definitions to MAGEC according to MAGEC's standards, but also enter the true Datacom/DB key names into the screen fields which as for "CA DD Name" on the KYFADD/KYFCHG screen.
If you leave the CA DD Name field blank, MAGEC defaults it to the MAGEC key name.
Similarly, MAGEC requires that your elements be named xxx00, xxx01, et cetera. Special meaning is attributed to certain element names, i.e. xxx00 is an Audit-Stamp, xxx99 is the Record Descriptor Word for a variable-length record (for those access methods which support variable-length).
If your Datacom/DB element definitions use names which do not follow MAGEC's standards, you must provide the actual Datacom/DB names into the screen fields asking for the CA Element Name on the ELTADD/ELTCHG screen.
MAGEC's I/O module will substitute the Datacom/DB names for the MAGEC names just prior to requesting for I/O services from Datacom/DB. Your programs will use only the standard MAGEC names. If you decide to convert one or more of your data files from Datacom to VSAM, or from VSAM to Datacom, no program changes or recompiles need be done.
records are being updated (incorrectly?)
Datacom/DB
Defining Keys
KYFxxx yyyKn |
NOTE: In the PC and LAN environments of MAGEC this field enables you to specify the drive (which may be a logical LAN drive) on which the data file and its indices exist. This allows you to have MAGEC installed on one LAN drive and to have your data files distributed across many drives, including having some on your local (C: or D:) drives. In MAGEC release 3.0 and later, this field is expanded to 79 bytes in length, allowing you to specify a complete filespec, including drive, path, and file name. If you specify an asterisk or space as the alphabetic drive ID, MAGEC will replace it with the LANDRV setting from your environment. If you leave the path and file name blank, MAGEC will use the default path and will use the DD Name as the file name. For example: if you specify "MYFILE" in the DD Name, and "J" in the Drive ID, and you are using MicroFocus Cobol, MAGEC will build a filespec of: J:\MAGMF\MYFILE.DAT. The ".DAT" extension is mandatory.
The Component Fields are the fields (up to 5) which make up the key. Max, min and type must be specified for each key component. At least one key component must be defined for the key. See the Key Normalization section of this chapter for further discussion.
is the expanded size of this key component in characters (or digits, if numeric).
is the minimum number of characters the operator may enter for this component.
is the data type as shown on lower portion of this screen.
If you would like to have test and production versions of your files then you may use a "symbolic" DD Name. A symbolic name is one which incudes the ampersand character (&) anywhere within it. All Test MAGEC User Views will replace the ampersand(s) with the letter "T"; all Production User Views will replace it with a "P".
Suppose you had a Production Customer Master file with the DD Name of:
All the other Dictionary definitions associated with the CUSMAS& file also have provision for Test and Production profiles, as you will see in the following topics. In all cases the Test profiles apply in all Test User Views and the Production profiles apply in the Production User Views.
The definitions of the Component Fields (up to 5 of them) are used by the program generator MMPCREAT to control the key Normalization logic which edits and formats the SKEY data into the proper representation for accessing the file. Max is the number of digits or characters which the component consists of in its DISPLAY form. A 9-digit packed field may be only 4 bytes long on the file but it is 9 digits long when displayed on the screen or entered onto the screen and therefore is defined with Max = 09. Min is the minimum number of digits or characters which you wish to permit the operators to enter when entering this key component. If Min is the same as Max then the operators will be required to enter the entire value, leading zeros and all. Min must not be larger than Max and may be 00. The MMP's will "pad" the entered key value with leading zeros (if numeric) or trailing blanks to the length specified in Max. They will automatically convert the numeric values to packed or binary format if appropriate.
Type indicates whether this key component is numeric or not and if it is numeric whether it is signed or not and whether it is packed or binary or zoned-decimal. We recommend that file keys be made up of alphanumeric and zoned-decimal data without signs unless particular circumstances do not permit. Experience has shown that packed key fields and ambiguities regarding signs (+
) can cause difficulties and confusion. MAGEC in no way causes or exacerbates these problems but it does not solve them either. If you do have files with packed and signed key fields they will be handled properly by MAGEC but it is still your responsibility to know whether a given record's key is signed with a C or F for positive or with a D or E for negative.
If you successfully add a new KYF definition then MAGEC will assume that you will most likely next want to add a new Element definition for the Data Class and will automatically present the ELTADD screen to you.
You may not add a KYF definition unless the Data Class is already defined (via DCLADD). Remember, if you wish the new definitions to take effect immediately (without waiting for the online system to be brought "down" and "up"), then you must use the **LOAD Function.
Unless a filespec is specified (refer to Drive ID in Figure 02), all data files must be in the \MAGxx directory and be named following the format:
where: xxxxxxxx = DD Name specified in the KYF definition. The symbolic ampersand character (&) is not supported in PC MAGEC. The .DAT extension is always required. With MicroFocus Cobol implementations a .IDX file is created automatically. It is the index for the .DAT file of the same name.
MAGEC supports alternate keys for any access method which permits them (primarily: VSAM, Datacom DB, and simulated VSAM in PC MAGEC). To define an alternate key (also called a Subordinate Key) simply do the KYFADD function for yyyKn (where yyy = Data Class name, n = digit from 2 thru 9). In the event you have more than nine keys for a single file you may use alphabetic "key numbers", but you may need to do some customization in generated programs trying to access that file. MAGEC will automatically generate the logic to support up to nine keys for all browse and query functions. All that you need do is have the KYF definitions on file at the time the MMP is generated. For file maintenance functions MAGEC always generates the logic to process only using the Primary Key (key 1).
NOTE:
When an operator is using a MAGEC-generated application and mis-enters the key value (on top line of the screen) and receives the "Invalid Key Format" message, he/she can press the HELP key (PF1) to receive online help text. You can store your own text (unlimited length) associated with any file key, or MAGEC will generate a default key format display to help the operator. Refer to the "Documentation" chapter for more details on Key HELP.
Test & Production Files
CUSMASP
and a Test version of it with the DD Name of:
CUSMAST
Then you would simply specify the symbolic DD Name of:
CUSMAS&
Your MMP's would access the Test file if executed from any Test User-View (TS01 thru TS08) and would access the Production file when executed from any Production User-View (PR01 thru PR08).
Key Normalization
PC MAGEC
xxxxxxxx.DAT
Alternate Indices
Key HELP
Defining Elements
ELTxxx yyynn |
An Element is the "unit of transfer" between MAGECIO and your programs. By intelligently dividing your records into Elements you can gain a degree of "data independence" for your applications. For instance, if a program uses only the first 45 bytes of data (let us say that is the demographic portion) then it should only "read" that much. If you discover that you must change the record format because you must add more data fields, lengthening the record and lengthening the second Element described in the above paragraph, then it is likely that you will not even have to recompile the program which reads only the first Element.
If another program requires both the first and second Elements it may read both in one CALL with no added overhead. That program would be affected by changes made to either of the two Elements. MAGEC allows you to define up to 99 Elements for a Data Class plus the special Element number 00. Remember, also, that a given physical file may be "redefined" by multiple Data Class definitions, each of which may have its own KYF and ELT definitions. Element number 00 is the name of the Audit Stamp element which must be 36 characters long. If the Data Class does not have an Audit Stamp (as specified on the DCL definition screen) then there should not be an Element 00 at all. If the Data Class does have an Audit Stamp then Element yyy00 must be specified (where yyy = Data Class name) as a 36-character element, it usually begins at displacement 0000 into the record (0004 if variable length).
When defining the Elements which make up a record we recommend that you assign Element numbers in ascending order starting with 01 (00 for the Audit Stamp) and starting at the beginning of the record proceeding toward the end leaving no gaps in either Element numbers or in bytes of the record left undefined.
We also recommend that you do not allow any Element to overlap any other. It is possible that a future release of MAGEC will not permit overlapping Elements, for now they are just "advised against". If a file is "redefined" as multiple Data Classes then, of course, the Element definitions for one Data Class will be allowed to overlap those for the other(s). The rule against overlapping Elements applies only within a Data Class.
In order to minimize the impact of file changes it may also be a good idea to leave a little FILLER space in each Element to accommodate minor changes without having to reformat the files.
04 xxx99-ELEMENT. |
05 xxx99-LGTH PIC S9(4) COMP. |
05 xxx99-PAD PIC S9(4) COMP. |
It is wise to be sure that the pad field is set to zero (low-values) and the length field is set to the desired record length before any add or update operation. Setting the length properly is the responsibility of the application developer.
When a program, either an online MMP or a batch program, accesses data from a variable-length file it should specify the 99 element as part of its Element List. If the program reads data and does not include element 99 then the record length will not be returned to it. If that program updates without setting the length (which it cannot do if it has not read element 99) then the MAGEC I/O module will set the new length equal to the old length -- which may or may not truncate some data from the record.
04 IVC01-ELEMENT. |
05 IVC01-MASTER-KEY. |
06 IVC01-CUSTOMER PIC 9(5). |
06 IVC01-INVOICE PIC 9(6). |
05 IVC01-DATE .... |
This would be on the MAGEC library as a member named IVC01-C and could be viewed or altered online via: LBRSEE IVC01-C. Notice that the Master key is defined as a group level item and broken down into its components. The group name IVC01-MASTER-KEY would be specified on the KYF file definition for IVCK1 and could be seen via the online Function:
KYFSEE IVCK1
The following topics set forth recommended standards for your data definitions and copybooks. We recommend that you use the MAGEC Dictionary's DIT file (Data Item file) to define your data and to generate your copybooks.
We realized that it may involve some extra effort to convert your preexisting data definitions to conform to the recommended standards and to enter the definitions into the Dictionary; therefore, we have provided a facility in the MAGECLBR utility program to automatically generate DIT file definitions from your old copybooks.
Your extra effort will be well rewarded since the definitions in the DIT file will enable MAGEC to provide a wide variety of services for you. The online access to the definitions is very useful for database administrators to maintain central control of the database. The online application development processes access the DIT file to validate developer's specifications and to provide intelligent default values. The DIT definitions help MAGEC to determine how to properly translate from ASCII to EBCDIC and vice-versa when your program is accessing data from foreign files via MAGEC's TCP/IP networking feature.
In order for MAGEC to be of the greatest value to you we strongly recommend that you adhere to some special naming conventions for your Data Items (fields within an Element). Remember, the Record of a Data Class (DCL) may be broken down into one or more Elements.
Each Element (ELT) may be broken down into one or more Data Items (DIT's). An Element, therefore, may be looked upon as a contiguous group of Data Items within the Record.
As you might have guessed from examples shown earlier in this book we have established a standard that all Cobol datanames for Data Items are prefixed by the name of the Element in which they appear. The name of a field (Data Item) which is to contain the Customer's balance and which is within the Element named CUS02 might be:
Similarly, all other fields within Element CUS02 would be named:
Recommended Standards
Defining Data Items
Cobol Datanames
Name Prefix
CUS02-BALANCE
CUS02-something-or-otherBecause of the Cobol limit on length of datanames "something-or-other" must not be longer than 24 characters. Of course, it must also conform to all other Cobol restrictions regarding special characters, etc.
06 eeeee-xxxxxxxxxxxxxxxxxxxxx-YY PIC XX. |
06 eeeee-xxxxxxxxxxxxxxxxxxxxx-MM PIC XX. |
06 eeeee-xxxxxxxxxxxxxxxxxxxxx-DD PIC XX. |
For dates with the 4-digit year, another 2-byte item is inserted above the -YY item which is named with the suffix -CC , to contain the century portion of the 4-digit year.
The generated MMP will automatically move each of the date's components individually so that the screen-image of the date may be in some other format from that of the database field; i.e. MM/DD/YY, or DD/MM/YY. The MMP generator assumes that you will adhere to this standard and will use the suggested suffixes and that each of the component fields will be PIC XX, not PIC 99.
06 eeeee-xxxxxxx PIC ..... |
06 eeeee-yyyyyyy PIC ..... |
The data name MASTER-KEY is merely suggested, not enforced. The field should be either a group item or an alphanumeric item, not a numeric (PIC 9) item. The component fields may be any type of data, numeric or alphanumeric.
When you defined the key definition (see KYFxxx functions) you specified the Cobol dataname of the key field. That name should match the name used in the DIT definition for that key field. The length (in bytes) of the field should match the length specified for the key in the KYF definition. If there is a discrepency, you will be issued a warning message at the time you have MAGEC generate the Cobol copybook for the Element.
You may use your preexisting Cobol copybooks in MAGEC-generated applications by simply cataloguing them to the MAGEC library using the MAGECLBR batch utility program as explained earlier; or you may let MAGEC generate a Cobol copybook for you from MAGEC Dictionary data. In order to have MAGEC generate your copybooks you must first define the Data Items (DIT's) to the Dictionary.
There are two ways you can define Data Items to the Dictionary:
The standard set of nine Functions is provided for the MAGEC DIT file to accommodate adding, updating, inquiring, and browsing. In addition, there are some extra Functions provided which allow you to resequence (renumber) the Data Items of an Element, to list the Data Items of an Element on the screen, and to generate the Cobol copybook of the Element using the DIT file definitions.
The key format for the DIT file records is:
The Mode defaults to T whenever it is omitted. As you can readily see you may have a Test and a Production set of definitions for any given Element. As you can also see the sequence (order) of the Data Items is controlled by the 6-digit sequence number. We suggest that when you are initially adding definitions for an Element's Items you increment the numbers by 100 to facilitate insertions (a time-proven technique).
If you reach the point where you have inserted a sufficient number of Items that you feel you are running out of available numbers to be used for further insertions then you may use the DITSEQ Function to renumber the Data Items (for that Element). DITSEQ will renumber in increments of either 10 or 100 (default = 100) allowing you to do more insertions. Detailed instructions for using all the DIT Functions are available online via the HELP key (PF1) at any time to anyone authorized to do the Function. Refer to the MAGEC Application User's Guide for instructions as to how to use the online documentation if you need to.
The special Functions which are provided in addition to the nine standard ones are:
You will be unable to add a Data Item until the Element to which it belongs has been defined on the ELT file (via ELTADD). Further, you must get "Exclusive Control" of the Element (and all its Data Items) before you will be able to do any form of database updating Function to the DIT file. See the Exclusive Control of ELT section of this chapter.
Creating a Copybook
1) by keying the definitions into the online Dictionary maintenance screens (DITxxx Functions).
2) by using another special feature of the MAGECLBR utility program to "read" your old copybook and automatically create the Dictionary definitions.If you use the second method you will probably also want to then use the online DITxxx Functions to look at and possibly modify the Data Item definition since default values will have been used for some parameters which could not be determined from the Cobol copybook.We strongly recommend that you use the MAGEC Dictionary to generate your "copybooks" since having the Data Item definitions available to MAGEC (via the Dictionary) is required for a large number of features and facilities which are either already implemented or are planned for future releases of MAGEC. We will continue to support the facility to catalogue books using the
"-MAGECADD LIB" contol card (as described in an earlier topic); but we intend for it to be used only in those cases in which defining the data to the Dictionary is not appropriate (such as WORKING-STORAGE areas, etc.). To define Data Items to the dictionary using your Cobol definition (old copybook) as input you would use the "-MAGECADD DIT" control card in MAGECLBR. See the "Offline Utilities" chapter for more detailed instructions regarding MAGECLBR.
DITxxx Functions
eeeee/m/999999
DITLST
list Data Items for an Element
DITSEQ
re-sequence Data Items for an Element
DITGEN
generate Cobol copybook for an Element
DITxxx EEEEE/M/999999 |
is a protected field which displays the Element description which comes from the definition on the ELT file.
is a protected field displaying the sequence number portion of the key for this Data Item.
is a protected field which displays the test or production mode (T or P).
is a required field which is the Cobol level number to appear in the generated copybook. It must be 04 thru 49 or 88.
is the desired Cobol data name to be generated in the copybook. Maximum size is 24 characters. MAGEC will prefix this name with the 5-character Element Name, plus a dash (-), giving a Cobol data name of up to 30 characters in the copybook.
is the number of significant digits to the left of the decimal point (or implied decimal point) for numeric Data Items. For Data Items which are dates (type M, D, or Y) this value specifies either a 02 or 04 to indicate a 2-digit or 4-digit year (such as 88 versus 1988). For other (non-numeric) Items this value must be 00.
is the number of decimal places (to the right of the decimal point) for numeric Data Items. For dates this value specifies the maximum age (in years) of a date which is to be accepted by the Automatic Editing.
is a code indicating whether this Data Item is to be defined with a "sign" (PIC S9, etc.) in the generated copybook definition. A value of S indicates signed, a value of U indicates unsigned. For non-numeric Items this must be blank. Numeric SQL data items must be signed.
is a code which specifies type of numeric data. It is only valid for numeric Data Items (as specified by the Type field described above). A value of P indicates Packed (COMP-3). A value of B indicates Binary (COMP or COMP-4). A value of D indicates Zoned Decimal (DISPLAY). Must be blank for non-numeric Data Items. Zoned Decimal illegal for SQL.
is the MAGEC Automatic Editing Edit Type (such as N for numeric, or X for alphanumeric, or $ for numeric with "$$,$$$.99" type Cobol editing, etc.) This is used as a default or suggested Edit Type when the developer references this Data Item as a "Source/Target" field on the MSKDEF screen. It does not mean that the database copybook will contain the Cobol edit pattern. The generated database Element copybook will use an appropriate data representation for file data based upon this Type parameter and other parameters such as SIG, DEC, COMP, etc.
is the Auto Edit Lookup Table number, if this is a type T item.
is the Requirement code (R or O) to indicate that this Item is a Required entry on the Maintenance screen, or Optional.
is the length (in bytes) of this Item. For numeric or date items MAGEC will calculate this for you. For alphanumeric items you must enter the length here. If the Level is 04 and the Data Name is "Element" MAGEC will fill in the length from the ELT file definition.
is a code indicating that this Item is left justified or right justified. A value of L or R is accepted. If left blank L will be assumed.
is the number of occurrences of this Item, if it is an arrayed Item. A value of 0 will indicate that this is not arrayed. A value of 1 is illegal. If you leave it blank, 0 will be assumed.
is the Cobol data name of the control Data Item which contains the number of occurrences of an arrayed Item if there are a variable number of occurrences. If this entry is non-blank, then the Occurs value above is interpreted to be the maximum number of occurrences, the minimum being 0.
is the data name of the Item which this Item redefines.
is the pattern for Pattern Edited fields (Edit Type "P" or "#"). For 88-level items, it is the value which this Condition Name defines. You can enter the actual literal here (such as 900 or X) and the DITGEN function will generate the surrounding quotes if needed. You can also enter the name of a library member which contains the value or list of values. This enables you to use value clauses which are far larger than would fit in the 20-character screen field. To enter a member name, just prefix it with an ampersand (i.e. &member/modifier) and the DITGEN function will generate an include statement in the Cobol copybook.
is the column heading to be generated above this Item on columnar lists (such as the LOC, SCN, and FND screens) or batch reports, and also as a screen prompt when MAGEC automatically generates maintenance screen layout.
is the name (up-to 20 characters) of the Domain to which this Data Item belongs. MAGEC will enforce consistency in the definitions of all Data Items within a given Domain.
is the up-to 20-character name used to identify this field to an SQL database. Used also to construct a Host Variable name. SInce an SQL identifier may not contain embedded spaces or hyphens, MAGEC automatically converts them to underscores. This is convenient since you cannot directly type an underscore into MAGEC screens because it is the universal fill character. SInce some SQL databases limit the identifier to 18 characters in length, you should limit your entries to 18 characters. In generating host variable names, MAGEC attempts to create unique names by prefixing them with the 5-character element name, if space permits, or with just the 3-character data class name -- or with nothing, if you have used more than 15 characters for your identifier. To ensure unique host variable names across multiple tables having identical database identifiers for some of their columns, limit your identifiers to 13 characters or fewer.The database identifier has no meaning for non-SQL data, it will be ignored. It is required only when the access method is SQL or DB2 (as specified on the DCL definition for the Data Class).
is the 8-line free-form text field which contains the explanation and any other comments to describe this Data Item. When an online application user invokes the field-level HELP by pointing to a screen field with the cursor and pressing PF2, this text will be presented along with a textual description which is generated from the specifications above.
is the calculated offset (within the Element) of this field, and its length in bytes. This is displayed for informational purposes only and is calculated by the DITGEN function described in Generating the Copybook, below. Until DITGEN has been executed these values are unreliable.
You can specify Cobol 88-level items (Condition Names) below any Data Item. The 88-levels are defined as separate Data Items which may only have the VALUE parameter specified and no others, exactly as in the compiler. For numeric items you just enter the numeric value as: 99, or 23, etc. You may also enter ranges as: 101 THRU 199. In order to support lists of values too large to be entered into the 88-Val/Pattern screen field (above), MAGEC allows you to enter the name of a library member which contains the values. Refer to description above.
You must have exclusive control of the Element (and all its Data Items) before you will be able to do any form of database updating Function to the DIT file (DITADD, CHG, DEL, GEN, or SEQ). Exclusive Control means that only you are allowed to do any form of updating and all other persons will be prevented from updating that Element's Data Items until you are finished. This prevents the confusion which might result from more than one person making changes to the same Element. If you wish to see who has control of it, use the Function:
To get Exclusive Control of an Element, use the ELTCHG Function and then enter your Employee Number (same as you use to SYSLOG ON) into the screen field labeled:
If there is already another person's Employee Number in that field you should check that he/she no longer needs to retain Control of that Element. On the other hand, when you are finished you can save someone else a bit of aggravation if you remember to remove your Employee Number from the ELT-record field by changing it to zeros.
In some cases you may want more than one person to be able to do updating Functions to the DIT records of an Element at the same time. An example would be to speed up the entry of the Data Item definitions for a large Element by dividing the work among several persons. To do that you might have all of them SYSLOG on using the Employee Number of the person having exclusive control. The employee would have to have multi-terminal logon capability specified on his/her SIF file profile in order to do this.
88-levels
Exclusive Control of ELT
ELTSEE eeeee
Employee Number Having Temporary Exclusive Control:
Allowing Multiple Persons Access
06 eeeee-SECTIONAL PIC 9(3). |
06 eeeee-SUFFIX PIC 9(2). |
Now, suppose you added an 88-level Item "below" the ZIP-CODE, as:
seq # level name PIC VALUE
000150 88 OUR-TOWN 75252
When you generate the copybook you will see:
05 eeeee-ZIP-CODE PIC 9(5).
88 eeeee-OUR-TOWN VALUE 75252. |
05 FILLER REDEFINES eeeee-ZIP-CODE.
06 eeeee-SECTIONAL PIC 9(3). |
06 eeeee-SUFFIX PIC 9(2). |
You may at some time accidentally define Data Items in the wrong sequence and need to correct the error by moving one or more Item(s) either before or after another. Since the order of the Items is controlled by their assigned sequence numbers and since the sequence number is a part of the actual record key you must use a two-step process to accomplish the move.
First, you must use the DITDUP Function to duplicate the Item to be moved. Duplicate it to a sequence number which places it where you want it to be.
Next, you must use the DITDEL Function to delete the old record. If you like you may then use the DITSEQ Function to renumber into nice neat increments of 10 or 100.
To generate the copybook for an Element you must enter:
If no one else currently has Exclusive Control of the Element then you will automatically be given Control. It is up to you to reset the Control when you are finished working with that Element by using the ELTCHG Function and zeroing the "Employee Number Having Control" field.
If you make an error in the key entry (eeeee/m) or if some other error occurs then you will receive an appropriate error message; otherwise the copybook will be generated and added to the MAGEC Library (ALG file) with the correct standard member name (eeeee-C) and it will be displayed to you immediately via the standard "LBRSEE eeeee-C" screen.
To protect against your accidentally generating a copybook for the wrong Element MAGEC will present a screen to you with instructions to press PF14 to generate the book. On that screen it will tell you the name of the Element and the Member Name of the book to be generated and will remind you that the new book will overlay/replace any preexisting Member of the same name. If all is correct then just press the PF14 key.
As DITGEN is generating your Cobol copybook it will scan for possible errors and issue a warning notification to you if any were found. For instance, if the key field (as specified in the KYF definition "Cobol Name") is the wrong length, or a numeric type field, you will be told that a potential problem exists. DITGEN will go ahead and create the copybook regardless of these "soft" errors.
If the access method of the Data Class is SQL or DB2, the DITGEN function will automatically fetch to the SQLGEN function which will generate the SQL Host Variable definitions and store them in a member named:
As of MAGEC release 3.0, the DITGEN function also parses the DIT definitions to construct a highly compressed table of translation parameters to be used by MAGECIO when an application accesses data from another machine (a Host machine) which uses a different coding scheme (ASCII vs. EBCDIC) from the machine on which the application is executing. In order to produce accurate parameters DITGEN accomplishes more extensive validations than in earlier releases of MAGEC. If discrepencies are encountered, DITGEN will stop and display an error message. If you wish to ignore these more thorough validations, you can press PF5 in lieu of PF14 (a message on the screen tells you this, as well). We recommend that you use PF5 here only in exceptional cases. It is best to go back to the DIT definitions and correct the errors noted, then redo DITGEN. The PF5 feature is there only to enable you to revert to the earlier, lower standard in an emergency situation. The hope is that at some future time you will return and correct any errors you have ignored to bring your data definitions up to current standards. Using the PF5 feature causes DITGEN to insert a warning message into your generated copybook to remind you that you have ignored some errors.
As a byproduct of this more thorough validation, DITGEN is able to update each DIT definition with the offset and length (bytes) of each Data Item. These are displayed on the DIT screen for informational purposes only. The offset is relative to zero, with the first field in an Element having an offset of zero.
To re-sequence (renumber) the Data Items for an Element use the command:
Since the Mode defaults to T and the Increment also defaults, you may usually enter only the Element Name.
If an error is detected you will receive an appropriate message; otherwise the Data Items will be re-sequenced and the message:
will appear. Just press the ENTER key and the DITLST screen will be shown so you can verify the results if you like.
DON'T MODIFY THE GENERATED COPYBOOK!
If you alter the copybook for any reason and someone else (or even you) later alters the DIT file definition and regenerates the copybook then your modifications will be lost. Make your changes to the DIT file definitions and regenerate whenever changes need to be made.
Also, remember, planned features of MAGEC will use these DIT file definitions more and more. It is important that they be current and correct.
The DIT definitions, including the 8-line text narrative, are used in the field-level HELP facility of all MAGEC online applications. By pointing to a screen field with the cursor and pressing PF2, a user can invoke field-level HELP. The help text will consist of a combination of 1) the Data Item Narrative which is on the DIT definition, plus 2) technical specifications for the screen field which are translated into common English language. The specifications for screen fields are ordinarily inherited from the DIT which is given as its Source/Target database field.
Moving DIT's
Generating the Copybook
DITGEN eeeee/m
eeeee-C/SQL
Resequencing DIT's
DITSEQ eeeee/m/iii
PRESS ENTER TO SEE DATA ITEM LIST
Modifying Generated Copybook
Field-Level HELP