Generate for Natural

The following types of external objects can be generated for Natural:


Replace Verification Rule

The Replace Verification Rule function can be applied only to rules of status automatic. A rule is assigned status automatic by applying the function Generate DDM to the file containing the field that the corresponding Verification object is linked to via "Is verified by VE".

The function Replace Verification Rule replaces the code of the rule; all links to fields remain unchanged.

The following topics are covered below:

Parameters

Parameters for verification rule

Values for fields which have been locked by the data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.

Parameters
List related fields
Y The IDs of all fields connected to this verification rule via "Is verified by VE" are to be listed.
List related maps
Natural maps using replaced verifications are to be recataloged so that they use the new verification rules. List related maps helps to find these maps.
Y The IDs of all maps connected to this verification rule are to be listed.
List generated code
Y The generated code is to be listed.

Keywords

The schema generation wizard uses the following keywords when showing the command that is to be processed:

Field Keyword
Rule ID RULE-ID
List related fields RELATE
List generated code LIST  
List related maps RELATED-MAPS

If a parameter is not specified, the default value is taken.

Sample Output

    Link of Verification GEN-CHECK-ZERO to Elementary Fields
           File Name                        Field Name               Remark
-------------------------------- -------------------------------- -------------
GENERATION-EXAMPLE               ELE-N-9V5                        activ
                                 ELE-PS-5V2                       activ
                                 PC-MC-PS-6V1                     activ
Gen-examples                     Ele-N-9V5                        not activ
                                 Ele-PS-5V2                       not activ
                                 PC-MU-PS-6V1                     not activ

Rule: GEN-CHECK-ZERO

0010 * **********************************************************************
0020 * Verification: GEN-CHECK-ZERO generated by Predict                    *
0030 *  with format: Numeric; Type: Not Equal;                              *
0040 *           on: 2007-05-31; at: 13:03:46; from user: SMR;              *
0050 ************************************************************************
0060 IF & = 0
0070 REINPUT 'Invalid value(s): ''0'' .'
0080         MARK *&

Data Definition Module

The following topics are covered below:

Rules Applying to the Generation of DDMs

  • If Natural Security is installed and the specified file is defined to Natural Security, the same checks are performed as are performed before a DDM can be regenerated or a file can be added. See description of the parameter DDM Modifier in the section File Maintenance of the Natural Security documentation.

  • A DDM generated for a physically coupled file contains the ID of the file to which it is coupled and the short names of the fields via which they are coupled as a comment. For example: "Coupled via AA to GA of FINANCE".

  • The names of the Predict file and its userviews begin with SYSDIC. When a DDM is generated for a file whose name begins with SYSDIC, the logical database number (255) and logical file number (253) that point to the FDIC are taken.

  • If the file (which has a DDM) was renamed, the old DDM is purged in the Generate DDM function and the new DDM is added. If Natural Security objects or Super Natural objects exist for the old DDM, these objects are renamed too.

Note:
Rules applying to the generation of DDMs for use with IMS or Adabas Vista are described in the sections Generating DDMs for Use with IMS and Generating a DDM for Use with Adabas Vista.

When generating DDMs in Windows or Linux environments and the FDIC file is located on the mainframe, the DDM will not be available on the mainframe. It will be stored only in the file system where FDDM is located. When generating DDMs on the mainframe and the FDIC file is also located on mainframe, the DDM will not be available in the Windows or Linux environment. The function must be executed twice.

Rules Applying to the Generation of DDMs When Using Unicode

Database fields containing Unicode data are represented with the format U in the DDM, when running with Natural Version 4.2 for Mainframes or above, Natural Version 6.2 for Linux or above and Natural Version 6.2 for Windows or above.

Whether a field contains Unicode data, is determined in the following way:

  • For DB2 files (file types D, E, MT), the CCSID definition of the table (or of the underlying tables in case of views and materialized query tables) in the SQL Server specified in the DDM Generation defaults is evaluated.

    If it is set to U, the fields with format A, AV, AL or LO, and character set option set to S or to M and fields with format G, GV, or GL are represented with format U in the DDM. If no CCSID value is given, the CCSID definition of the related dataspace in the given SQL Server is checked.

  • For Adabas files (file types A, U, AT) each field with format A, AV, AL or LO and character set option M is represented with format U in the DDM.

Parameters

Before the following page is shown, another page may appear in which you have to select a database from a drop-down list box. Its appearence depends on specific defaults defined by the administrator and/or the object that has been selected on the first page of the wizard.

Example for Adabas:

Parameters for DDM

Values for fields which have been locked by your data dictionary administrator cannot be overwritten. These fields are skipped when positioning the cursor with the TAB key. See Generation Defaults.

Presettings
The parameters below can be changed in the Modify DDM Defaults screen of Predict. See Generation Defaults.
Specification DB ID
Only applicable to Adabas files and userviews.
Y Database ID must be specified.
N Database ID may be specified.
D Database ID may not be specified.
This parameter is set to N at installation.
Money format (for SQL)
N Unpacked numeric
P Packed numeric
Date/Time representation
A Alphanumeric / Char
D Date/Time

Note:
A representation as format D or T is only taken into account for DB2 tables and views and when executing the generation with Natural Version 4.1 for mainframes or above.

SQL Server The server that should be used for data access from Natural.

Note:
It is possible to define an index as clustered in one server and as not clustered in a second server. This influences whether the component fields of the index may be updated or not. Whether a field may be updated or not is indicated by special short names in the DDM for Natural.

Super Natural file DBNR The database number of the Super Natural system file must be supplied by the DDA if the Super Natural file is not the current FUSER file at generation time. This parameter is set to 0 at installation.
VSAM trailing BLANK char If a VSAM prefix name contains trailing blanks, these blanks must be represented in Predict with a special character (because trailing blanks cannot be entered in Predict). When generating a DDM for Natural VSAM the special character specified is removed and the correct representation of a blank inserted. A VSAM trailing BLANK char. is not defined at installation. We recommend setting this parameter to $.
Super Natural file FNR The file number of the Super Natural system file must be supplied by the DDA if the Super Natural file is not the current FUSER file at generation time. This parameter is set to 0 at installation.
Parameters
Replace
Y An existing DDM is overwritten.
List generated code
Y Generated code is listed.
Adabas version The version of Adabas for which the DDM is to be generated (see Adabas Version for more information). The Adabas version you specify for DDM generation is independent of your installation platform.
Field name prefix Prefix to be used for each generated field name.

Note:
This parameter does not apply if you are generating a DDM from an SQL file type.

Line comments
Y The first abstract line from each Predict field object is truncated to 20 characters and appended as a line comment to the generated description.
N No line comments are generated from Predict object.
O Occurrences defined in Predict.
Abstract The number of Predict abstract lines to be included in the generated code as lines beginning with an asterisk.
General comments
Y Comment lines in the Predict file object (marked with ** or */ in field Type) are included. If the field synonym is used, the original field name is displayed. The date and time of the generation and the ID of the user who initiated it are inserted. Source fields of sub/super/hyperdescriptors are also listed.
N Comment lines are not included. Source fields of sub/super/hyperdescriptors are not listed.
D Derivation only. Similar to Y, but comment lines are only included, where a derivation occurs. Source fields of sub/super/hyperdescriptors are also listed.
Generate verification rules
Y The status of verification objects connected to fields of this file via "Is verified by VE" is changed to automatic.
Replace verification rules
Y Verification objects of status automatic connected to fields of this file via "Is verified by VE" are regenerated if they have been modified since generation.
S Verification objects of status automatic connected to fields of this file via "Is verified by VE" are regenerated only if they are not connected to any other file.
List verification rules
Y List the IDs of all verification objects connected to each field.
Action after generation
none No further action will be taken after a successful generation.
Add to existing Natural project The generated DDM will be added to an already existing Natural project after a successful generation.
Add to new Natural project The generated DDM will be added to a new Natural project after a successful generation.
For Adabas
Use Vista access-nr See table Meaning of Parameter Use Vista access-nr.

Note:
This parameter is only applicable to Adabas files and userviews.

See also section Adabas Vista in the Predict and Other Systems documentation.
Long fields as DYNAMIC
Controls whether fields with format LO or AV in files of type A/U are generated with dynamic or fixed length in the DDM.
Y Yes.
N No.
S As defined in Predict. This is the default value.
For SQL
Truncate creator
Y The name of the generated DDM is the original SQL table/view name without the part that identifies the creator.

Note:
Only applicable to SQL file types.

NAT-l for long fields
Y Fields longer than 253 and with Natural field length specified are represented as multiple fields (M) in the generated DDM.
N The specified field length ist taken.
For IMS
Generate UDFs
Y User-defined fields for Natural for DL/I are generated or regenerated.
Only applicable to files of type I, J, and K.
Replace UDFs
Y Any user-defined fields are replaced.
List UDFs
Y User-defined fields are to be listed.
IMS field suffix
Y The DDM field name is created using a compressed field name (or Natural synonym), hyphen and IMS segment name.
For Natural subsystems
Define in security
Only applicable if Natural Security is installed and the user is authorized to create profiles. An authorized user is an administrator who either has no owners or is an owner of himself without countersignatures.
Y An authorized user can create a Natural Security profile for the file whose DDM has just been generated.

Generating DDMs for Use with IMS

When generating a DDM for one of the IMS file types, the following fields are included:

For all file types (I, J, K)

  • KEY fields from the higher level IMS segments

  • KEY fields from the current IMS segment

  • KEY fields from the lower level IMS segment if data is accessed via an AIX index

Additionally for IMS Segments (file type I)

  • user-defined fields of all IMS segment layouts (file type J)

  • user-defined fields of the related logical child or logical parent segment

IMS Segment (file type J)

  • user-defined fields of the named IMS segment layout

  • user-defined fields of the related logical child or logical parent segment

IMS userview (file type K)

  • user-defined fields of the named IMS User View file

  • user-defined fields of the related logical child or logical parent segment

Generating a DDM for Use with Adabas Vista

Prerequisites

If an Vista access number is used for generating a DDM, the virtual machine of the Vista element used for generation must be linked to the current network.

Changing the Current VM and Current Network is described under Miscellaneous in the Predict Administration documentation.

Recommendations when Using Adabas Vista

If using Dictionary View with Adabas Vista distributed data processing, we recommend the following:

  • Always enter Vista access numbers for Adabas files and userviews (Add, Modify file in Predict).

  • Set the parameter Specification DB ID in the Modify DDM defaults screen of Predict to D (database ID may not be specified when generating a DDM from an Adabas file/userview) or to N (database ID may be specified but is not mandatory). If this parameter is set to Y, the user is forced to enter a database ID when generating a DDM from an Adabas file/userview.

  • Set the parameter Use Vista access-nr in the Modify DDM defaults screen of Predict to T, but do not protect the field.

  • Do not enter a database ID when generating a DDM. This ensures the Vista access number is used for generation.

If you do not want to use Adabas Vista:

  • Set the parameter Use Vista access-nr in the Modify DDM defaults screen of Predict to N and deactivate the option by blanking out the preceding X.

The table below illustrates the use of the parameter Use Vista access-nr.

Meaning of Parameter Use Vista access-nr

Specification DB ID Use Vista Access-Nr Database ID specified Result
D,N N no DDM is generated with DB ID=0
D,N Y no

If the file does not contain Vista access numbers, an error message is given.

If the file contains Vista access numbers, a DDM is generated with the access numbers taken from the file.

D,N T no

If the file does not contain Vista access numbers, an error message is given.

If the file contains Vista access numbers, the system tests whether a Vista element with the same numbers exists for this file. If so, a DDM is generated with this access numbers.

N,Y N yes [1] If the file is not defined as partitioned in this database and the Adabas attribute Vista access only is not set to Y: the DDM is generated with the physical database number and physical file number (defined with file maintenance function Modify Adabas attributes).
N,Y N yes

[2] If the file is defined as partitioned in this database or the Adabas attribute Vista access only=Y: the system checks whether a Vista element for this file and database exists.

If exactly one element exists, the DDM is generated with the Vista numbers defined in this Vista element.

If more than one Vista element is found, no DDM is generated and an error message is given.

N,Y T,Y yes

Same as above, except that if several Vista elements exist for the file and database, the system checks whether the Vista access numbers of the file are identical to the Vista numbers of one of these Vista elements.

If identical, the DDM is generated.If not, no DDM is generated and an error message is given.

Keywords

The schema generation wizard uses the following keywords when showing the command that is to be processed:

Field Keyword
File ID FILE-ID
Database ID DATABASE-ID
Replace REPLACE
Field name prefix PREFIX
Line comments LINE-COM
General comments GENERAL-COM
Abstract SHORT-COM
List generated code LIST
Generate verification rules GENERATE-RULE
Replace verification rules REPLACE-RULE
List verification rules LIST-RULE
Generate UDFs GENERATE-UDF
Replace UDFs REPLACE-UDF
List UDFs LIST-UDF
Adabas version ADA-VER
Truncate creator TRUNC-CREATOR
IMS field suffix IMS-SUFFIX
Use Vista access nr. USE-ACCESS-NR
Define in security ADD-SECURITY
Status 1) STATUS
DDM Modifiers 1) MODIFIER1
DDM Modifiers 1) MODIFIER1-COUNTER-SIGN
DDM Modifiers 1) MODIFIER2
DDM Modifiers 1) MODIFIER2-COUNTER-SIGN
DDM Modifiers 1) MODIFIER3
DDM Modifiers 1) MODIFIER3-COUNTER-SIGN
DDM Modifiers 1) MODIFIER4
DDM Modifiers 1) MODIFIER4-COUNTER-SIGN
DDM Modifiers 1) MODIFIER5
DDM Modifiers 1) MODIFIER5-COUNTER-SIGN
DDM Modifiers 1) MODIFIER6
DDM Modifiers 1) MODIFIER6-COUNTER-SIGN
DDM Modifiers 1) MODIFIER7
DDM Modifiers 1) MODIFIER7-COUNTER-SIGN
DDM Modifiers 1) MODIFIER8
DDM Modifiers 1) MODIFIER8-COUNTER-SIGN
Owner 1) OWNER1
Owner 1) OWNER1-COUNTER-SIGN
Owner 1) OWNER2
Owner 1) OWNER2-COUNTER-SIGN
Owner 1) OWNER3
Owner 1) OWNER3-COUNTER-SIGN
Owner 1) OWNER4
Owner 1) OWNER4-COUNTER-SIGN
Owner 1) OWNER5
Owner 1) OWNER5-COUNTER-SIGN
Owner 1) OWNER6
Owner 1) OWNER6-COUNTER-SIGN
Owner 1) OWNER7
Owner 1) OWNER7-COUNTER-SIGN
Owner 1) OWNER8
Owner 1) OWNER8-COUNTER-SIGN
Security Notes 1) NOTE1
Security Notes 1) NOTE2
Security Notes 1) NOTE3
Security Notes 1) NOTE4
Security Notes 1) NOTE5
Security Notes 1) NOTE6
Security Notes 1) NOTE7
Security Notes 1) NOTE8
Security Notes 1) NOTE9
Security Notes 1) NOTE10
NAT Length NAT-LENGTH
Long fields as DYNAMIC LONG-DYNAMIC

If a parameter is not specified, the default value is taken.

1) Only available in Natural Security. For further details and possible values see the Natural Security documentation.

Sample Output

       DBID: 180  FNR: 171  DDM: GENERATION-EXAMPLE               DEF.SEQ:

T L  DB  NAME                             F LENG  S D REMARKS
- -  --  -------------------------------- - ----- - - -----------------------
*    Generation started
*    at 2007-05-31 13:19:05
*    by user MSZ
*
*
*   EXAMPLE FILE FOR THE
*               GENERATION SUBSYSTEM
*
G 1  AA  GROUP-1
  2  AB  ELE-N-9V5                        N 9.5   N
         HD=ELE/HEADER

   VER:  GEN-CHECK-ZERO

G 2  AC  GR-IN-GROUP
  3  AD  ELE-B-4                          B 4.0   F D

   VER:  GEN-VER-EXAM

  3  AE  ELE-PS-5V2                       P 5.2   N

   VER:  GEN-CHECK-ZERO

*   MU field in group redefined two
*   times
M 3  AF  MU-B-4                           B 4.0   N
  2  AG  ELE-A-42                         A 42.0  N

   VER:  GEN-CHECK-BLANK
   VER:  GEN-VER-EXAM

  2  AH  ELE-F-8                          F 8.0   F
  2  AI  ELE-B-3                          B 3.0   N
*   Superfield and superdescriptor
  1  AJ  SB-ELE-A-5                       A 5.0   N
*        -------- SOURCE FIELD(S) -------
*        ELE-A-42(10-14)

  1  S1  SP-DE-A-24                       A 24.0  N S
*        -------- SOURCE FIELD(S) -------
*        ELE-B-3(1-3)
*        ELE-A-42(20-36)
*        ELE-PS-5V2(1-4)
*
*   PE-group with automatic counter
*
P 1  AL  PC-OCC-7
  2  AM  PC-ELE-DE-NS-7V3                 N 7.3   N D
*   counter for MU-field in PE-group
M 2  AN  PC-MC-PS-6V1                     P 6.1   N D

   VER:  GEN-CHECK-ZERO

*
G 2  AO  PC-GR
  3  AP  PC-ELE-I-2                       B 2.0   F
Format 'INTEGER' changed to 'BINARY'.
  3  AQ  PC-PS-20V7                       P 20.7  N
  2  AR  PC-ELE-F-4                       F 4.0   F
*   Formats: date,time,logical
  1  AS  ELE-D                            D 6.0   N
  1  AT  ELE-T                            T 12.0  N
  1  AU  ELE-L                            L 1.0   N
*   Hyperdescriptor with MU field
*   and source field of a PE-group
M 1  S2  HQ-DE-I-4                        I 4.0     H
*        -------- SOURCE FIELD(S) -------
*        PC-ELE-I-2
*        MU-B-4
***** DDM replaced *****