The following types of external objects can be generated for Natural:
IMS UDFs are required to access data in IMS segments from Natural for DL/I programs. UDFs are used for mapping IMS segments to fields in DDMs.
IMS UDFs for physical or logical IMS segments can be generated from Predict file objects of type I. IMS UDFs contain the segment name and - in the case of physical IMS segments - the user-defined field definitions for one IMS segment.
When generating IMS UDFs for logical IMS segments, the IMS UDFs for physical IMS segments that the logical IMS segments are derived from are also generated if necessary (if they do not already exist or if the Predict file objects for the physical IMS segments have been modified since generation).
The following topics are covered below:
In a first step the Generate IMS User-Defined Fields function collects file objects of the types I, K or J that are affected by the operation and displays them in a table. See Displaying all Predict file objects affected by UDF Generation.
The offsets of the IMS descriptor fields in the IMS segment layout (file type J) are checked for consistency with the respective descriptor fields in IMS segments (file type I) before an IMS UDF is actually generated.
A database and file number is assigned to the newly generated IMS UDF. DDMs use this database number and file number.
If differences between the format of IMS descriptor fields in the NDB and the respective format definitions of Predict are detected, the IMS descriptor field formats in the NDB are changed. Differences can occur if the descriptor fields have the format packed or packed-signed.
The Generate IMS UDF screen is displayed
with function code G and object code UD in a Predict main menu, or with the
command GENERATE UDF
13:45:33 ***** P R E D I C T ***** 2007-05-31 Plan 0 - Generate IMS UDF - File ID ..........* Contained in DA ... Overwrite option .. Y (Y,N) List IMS segment .. Y (Y,N) |
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.
Parameters | |||
---|---|---|---|
File ID | ID of the Predict file object from which UDF is to be generated. The file must be of type I. Enter an asterisk to display a selection screen. Alternatively, use an asterisk as a wildcard. For example, enter A* to display IDs beginning with A only. | ||
Contained in DA | ID of the Predict database containing the file. Must be of type I and the file list of the database must contain the file. | ||
Overwrite option |
|
||
List IMS segment |
|
Before actually generating IMS UDFs, Predict checks which file objects of the types I, K or J are affected and displays the results of this check in a table.
13:00:32 ***** P R E D I C T ***** 2007-05-31 - Checked IMS files - File Segm. File name Type Type Relation Udf DBnr/Fnr PARTUSED-LCONTD I L entered file nonexist ARTICLE-CONTAIND I V virt.child ARTICLE-PART I P log.parent nonexist ARTICLE-CONTAINS I C real.child nonexist |
Columns in the Table | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
File name | ID of a Predict file object. | ||||||||||||||
File Type | Predict file type. | ||||||||||||||
Segment Type | Type of IMS segment. | ||||||||||||||
Relation |
|
||||||||||||||
UDF |
|
||||||||||||||
DBnr/Fnr | Database and file number assigned to the UDF.
Note: |
Command: GENERATE UDF
Enter parameters on next line in positional or keyword form. File ID is obligatory, all other parameters are optional. If a parameter is not specified, the default value is taken.
Field | Keyword | Position |
---|---|---|
File ID | FILE-ID | 1 |
Contained in DA | DATABASE-ID | 2 |
Overwrite option | REPLACE | 3 |
List IMS segment | LIST | 4 |
Database: PARTUSED DBD: File : PARTUSED-LCONTD IMS Segment: LCONTD Seg. length: 600-700 T L DB Field name F Length D Occ Offset Var -- - -- -------------------------------- -- -------- --- --- ------- --- 1 NG PARTNO N 3.0 SRC 201 1 NH PARTNAME A 20.0 SRC 291 1 NI XPART A 20.0 AIX 200 **** IMS udf generated ( Dbnr: 153 Fnr: 84 ) ****
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:
The Replace Verification Rule screen is
displayed with function code G and object code RU in a Predict main menu, or
with the command GENERATE RULE
.
09:40:26 ***** P R E D I C T ***** 2007-05-31 Plan 0 - Replace Verification Rule - Rule ID ............... List related fields ... Y (Y,N) List related maps ..... Y (Y,N) List generated rule ... Y (Y,N) |
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 | |||||
---|---|---|---|---|---|
Rule ID |
ID of the Predict verification object from which the verification rule is to be generated. Enter an asterisk to display a selection screen. Alternatively, use an asterisk as a wildcard. For example, enter A* to display IDs beginning with A only. |
||||
List related fields |
|
||||
List related maps |
|
||||
List generated code |
|
Command: GENERATE RULE
Enter parameters on next line in positional or keyword form. Rule ID is obligatory, all other parameters are optional.
Field | Keyword | Position |
---|---|---|
Rule ID | RULE-ID | 1 |
List related fields | RELATE | 2 |
List generated code | LIST | 3 |
List related maps | RELATED-MAPS | 4 |
If a parameter is not specified, the default value is taken.
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 *&
The following topics are covered below:
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 UNIX 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 UNIX environment. The function must be executed twice.
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 UNIX 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.
The Generate a DDM screen is displayed
with function code G and object code DD in a Predict main menu, or with the
command GENERATE DDM
.
13:43:41 ***** P R E D I C T ***** 2009-07-20 Plan 0 - Generate a DDM - Current VM ............. HOME File ID ...............* Contained in DA ........ For Adabas Overwrite option ....... Y (Y,N) Use Vista access-nr ....* N List generated code .... Y (Y,N) Long fields as DYNAMIC .* S Adabas version ........* I8 For SQL Truncate creator ........ N (Y,N) Field name prefix ...... NAT-l for long fields ... N (Y/N) Line comments .........* Y For IMS Abstract ............... 3 (0-16) Generate UDFs ........... N (Y,N) General comments ....... Y (Y,N) Replace modified UDFs ... N (Y,N) List UDFs ............... N (Y,N) Generate verif. rules .. Y IMS field suffix ........ N (Y,N) Replace verif. rules ..* Y For Natural Subsystems List verif. rules ...... Y (Y,N) Generate security ....... N (Y,N) Super Natural file ...... N (Y,N) Command ===> Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12--- Help Next Stop Last LnkEl Flip Print Impl AdmFi SelFi Prof Main |
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. See Generation Defaults. | |||||||||||
Specification DB ID |
|
||||||||||
Money format (for SQL) |
|
||||||||||
Date/Time representation |
|
||||||||||
SQL Server | The server that should be used for data access from
Natural.
Note: |
||||||||||
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 | |||||||||||
Current VM | Virtual machine that is currently valid. A read only
field. DDMs can be only generated from Predict file objects contained
|
||||||||||
File ID | ID of the Predict file object from which the definitions are to be generated. Alpha characters must be entered in upper case. Enter an asterisk to display a selection screen. Alternatively, use an asterisk as a wildcard. For example, enter A* to display IDs beginning with A only. | ||||||||||
Contained in DA |
Depending on the setting of Specification DB ID in the Modify DDM defaults screen, entry of a database ID is mandatory, optional, or prohibited for Adabas files and userviews. See Presettings above. If a database is specified, its file list must contain the specified file and the database type must be compatible with the database type specified for this database number within the Natural Parameter Module (via NTDB macro). Enter an asterisk to display a list of databases for selection. Do not enter a Database ID for a DB2 table or view. |
||||||||||
Overwrite option |
|
||||||||||
List generated code |
|
||||||||||
Adabas version | The version of Adabas for which the DDM is to be generated (enter an asterisk for valid values or 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: |
||||||||||
Line comments |
|
||||||||||
Abstract | The number of Predict abstract lines to be included in the generated code as lines beginning with an asterisk. | ||||||||||
General comments |
|
||||||||||
Generate verif. rules |
|
||||||||||
Replace verif. rules |
|
||||||||||
List verif. rules |
|
||||||||||
For Adabas | |||||||||||
Use Vista access-nr | See table
Meaning of
Parameter Use Vista access-nr.
Note: |
||||||||||
Long fields as DYNAMIC |
|
||||||||||
For SQL | |||||||||||
Truncate creator |
|
||||||||||
NAT-l for long fields |
|
||||||||||
For IMS | |||||||||||
Generate UDFs |
|
||||||||||
Replace UDFs |
|
||||||||||
List UDFs |
|
||||||||||
IMS field suffix |
|
||||||||||
For Natural subsystems | |||||||||||
Generate security |
|
||||||||||
Super Natural file opt. |
|
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
Please note the following when generating DDMs for SQL file types:
Parameter Truncate creator only applies when generating DDMs for the file types listed below.
Natural synonyms and parameter Field name prefix are ignored for these file types.
SQL file types are
SQL File Types | |
---|---|
A(SQL) | Adabas (with SQL usage set to Y) |
AT | Adabas table cluster |
B | Adabas SQL view |
BT | Adabas D table |
BV | Adabas D view |
D | DB2 table |
E | DB2 view |
IT | Intermediate table |
JT | Ingres table |
JV | Ingres view |
MT | DB2 query table |
OT | Oracle table |
OV | Oracle view |
X | General SQL file |
XT | Informix table |
XV | Informix view |
YT | Sybase table |
YV | Sybase view |
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.
If using Predict with Adabas Vista distributed data processing, we recommend the following:
Always enter Vista access numbers for Adabas files and userviews (Add, Modify file ).
Set the parameter Specification DB ID in the Modify DDM defaults screen 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 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 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.
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. |
Command: GENERATE DDM
Enter parameters on next line in positional or keyword form. File ID is obligatory, all other parameters are optional.
Field | Keyword | Position |
---|---|---|
File ID | FILE-ID | 1 |
Database ID | DATABASE-ID | 2 |
Overwrite option | REPLACE | 3 |
Field name prefix | PREFIX | 4 |
Line comments | LINE-COM | 5 |
General comments | GENERAL-COM | 6 |
Abstract | SHORT-COM | 7 |
List generated code | LIST | 8 |
Generate verif. rules | GENERATE-RULE | 9 |
Replace verif. rules | REPLACE-RULE | 10 |
List verif. rules | LIST-RULE | 11 |
Generate UDFs | GENERATE-UDF | 12 |
Replace UDFs | REPLACE-UDF | 13 |
List UDFs | LIST-UDF | 14 |
Adabas version | ADA-VER | 15 |
Truncate creator | TRUNC-CREATOR | 16 |
IMS field suffix | IMS-SUFFIX | 17 |
Use Vista access nr. | USE-ACCESS-NR | 18 |
Generate security | ADD-SECURITY | 19 |
Status 1) | STATUS | 20 |
DDM Modifiers 1) | MODIFIER1 | 21 |
DDM Modifiers 1) | MODIFIER1-COUNTER-SIGN | 22 |
DDM Modifiers 1) | MODIFIER2 | 23 |
DDM Modifiers 1) | MODIFIER2-COUNTER-SIGN | 24 |
DDM Modifiers 1) | MODIFIER3 | 25 |
DDM Modifiers 1) | MODIFIER3-COUNTER-SIGN | 26 |
DDM Modifiers 1) | MODIFIER4 | 27 |
DDM Modifiers 1) | MODIFIER4-COUNTER-SIGN | 28 |
DDM Modifiers 1) | MODIFIER5 | 29 |
DDM Modifiers 1) | MODIFIER5-COUNTER-SIGN | 30 |
DDM Modifiers 1) | MODIFIER6 | 31 |
DDM Modifiers 1) | MODIFIER6-COUNTER-SIGN | 32 |
DDM Modifiers 1) | MODIFIER7 | 33 |
DDM Modifiers 1) | MODIFIER7-COUNTER-SIGN | 34 |
DDM Modifiers 1) | MODIFIER8 | 35 |
DDM Modifiers 1) | MODIFIER8-COUNTER-SIGN | 36 |
Owner 1) | OWNER1 | 37 |
Owner 1) | OWNER1-COUNTER-SIGN | 38 |
Owner 1) | OWNER2 | 39 |
Owner 1) | OWNER2-COUNTER-SIGN | 40 |
Owner 1) | OWNER3 | 41 |
Owner 1) | OWNER3-COUNTER-SIGN | 42 |
Owner 1) | OWNER4 | 43 |
Owner 1) | OWNER4-COUNTER-SIGN | 44 |
Owner 1) | OWNER5 | 45 |
Owner 1) | OWNER5-COUNTER-SIGN | 46 |
Owner 1) | OWNER6 | 47 |
Owner 1) | OWNER6-COUNTER-SIGN | 48 |
Owner 1) | OWNER7 | 49 |
Owner 1) | OWNER7-COUNTER-SIGN | 50 |
Owner 1) | OWNER8 | 51 |
Owner 1) | OWNER8-COUNTER-SIGN | 52 |
Security Notes 1) | NOTE1 | 53 |
Security Notes 1) | NOTE2 | 54 |
Security Notes 1) | NOTE3 | 55 |
Security Notes 1) | NOTE4 | 56 |
Security Notes 1) | NOTE5 | 57 |
Security Notes 1) | NOTE6 | 58 |
Security Notes 1) | NOTE7 | 59 |
Security Notes 1) | NOTE8 | 60 |
Security Notes 1) | NOTE9 | 61 |
Security Notes 1) | NOTE10 | 62 |
NAT Length | NAT-LENGTH | 63 |
Long fields as DYNAMIC | LONG-DYNAMIC | 64 |
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.
Note:
When generating a DDM in batch mode for database 0,
DATABASE-ID must be set to blank and at least one other parameter must be
specified in order that this parameter is recognized. For example:
GENERATE DDM FILE-ID=FILE1,DATABASE-ID= ,LIST=Y
or in positional form:
GENERATE DDM FILE1, ,,,,,,LIST=Y
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 *****