This section describes how to create a DDM by either copying DDMs or creating DDMs directly from the field definitions in a database. In addition, it provides information on how to generate multiple DDMs from an SQL database.
This section covers the following topics:
This section describes how to create a new DDM from an existing one.
If you want to copy DDMs between different libraries, database files, and/or hardware platforms, see also Maintaining DDMs in Different Environments.
If XREF entries exists for the DDM in the FDIC system file, they will also be copied for the new DDM.
 To copy a DDM
To copy a DDM
On the DDM Services screen, choose .
The DDM maintenance window appears with a list of all DDMs available.
In the DDM maintenance window, position the cursor at the DDM
                        					 you want to copy (in the example below: EMPLOYEES), enter the
                        					 function code C and press ENTER. 
                     
The Copy DDM to window appears preset to the name of the DDM to be copied as shown in the example below:
| 
 24/09/2004                       DDM Services              Library: SYSTEM        
 10:04:31               V 6.1.1 Pl 9   Software AG 2004     DBID   : 20         
 User: SAG                                                  FNR    : 14         
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                                +-------------+                                 
                                ¦   <CREATE>  ¦                                 
                                ¦ C EMPLOYEES ¦                                 
                                ¦   PERSONNEL ¦                                 
                     +----------- Copy DDM to -----------+                      
                     ¦ EMPLOYEES                         ¦                      
                     +-----------------------------------+                      
                                                            
                                                     
                                             
                                                                                
 Enter new DDM name | 
In the Copy DDM to window, replace the preset name by a new one and press ENTER.
The new DDM (here: EMPLOYEES_NEW) is saved as a
                        					 source and a cataloged object and is added to the list of DDMs:
                     
| 
 24/09/2004                       DDM Services              Library: SYSTEM        
 10:04:31               V 6.1.1 Pl 9   Software AG 2004     DBID   : 20         
 User: SAG                                                  FNR    : 14         
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                              ¦   EMPLOYEES     ¦                               
                              ¦   EMPLOYEES_NEW ¦                               
                              ¦   PERSONNEL     ¦                               
                              ¦   VEHICLES      ¦                               
                              +-----------------+                               
                                                                                
                                                                                
                                
                                                                                
 Select DDM | 
This section describes how to create a new DDM from an Adabas database by using the <CREATE> menu option.
 To create a DDM from an Adabas database
To create a DDM from an Adabas database
On the DDM Services screen, choose .
The DDM maintenance window appears.
From the top of the DDM maintenance window, choose .
The Select Database window appears as shown in the example below:
| 
 24/09/2004                       DDM Services              Library: SYSTEM        
 10:04:31               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                 +------------- Select Database -------------+                  
                 ¦ DBID     1                                ¦                  
                 +-------------------------------------------+                  
                              ¦   VEHICLES      ¦                               
                              +-----------------+                               
                                                                      
                                                                                
                                                                                
                                                                                
 Enter database number (0 - 65535 except 255) | 
Enter the database ID (DBID) of the
                        					 Adabas file for which a DDM is to be created. Valid values are 0 -
                        					 65535, except 255. If you enter a 0
                        					 (zero), the database ID specified with the Natural profile parameter
                        					 UDB (see the
                        					 Parameter Reference documentation) of the NATPARM
                        					 parameter file is used. 
                     
If the specified DBID identifies an Adabas database, the Create ADABAS DDM window appears:
| 
 24/09/2004                       DDM Services              Library: SYSTEM        
 10:04:31               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                 +------------ Create ADABAS DDM ------------+                  
                 ¦ FNR      1                                ¦                  
                 ¦ DDM Name                                  ¦                  
                 ¦ Password                                  ¦                  
                 +-------------------------------------------+                  
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
 Enter file number (1 - 5000) | 
Enter the file number (FNR) of the
                        					 database file for which a DDM is to be created (valid values: 1 -
                        					 5000) and the name to be assigned to the DDM. If access to the
                        					 Adabas file is protected, a password is required. 
                     
Press ENTER.
If the specified database and the file are available, the DDM editor is invoked and the fields contained in that database file are read into the editing area.
If the specified database is not active or cannot be accessed or if the file does not exist, a corresponding error message is issued. Nevertheless, if you press ENTER, you can still open an empty DDM editor screen, enter new field attribute definitions and save the DDM source. However, in this case you cannot check any definitions against the database file description.
If required, edit the DDM: see the section Using the DDM Editor.
After editing, press ESC and, from the MISC menu choose . See also Saving and Cataloging a DDM.
The syntax of the DDM source is checked and the DDM is saved as a source and a cataloged object.
This section describes how to create a DDM from an SQL database using the <CREATE> menu option.
 To create a DDM from an SQL database
To create a DDM from an SQL database
On the DDM Services screen, choose .
The DDM maintenance window appears.
From the top of the DDM maintenance window, choose .
The Select Database window appears as shown in the example below:
| 
 24/09/2004                       DDM Services              Library: SYSTEM        
 10:04:31               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                 +------------- Select Database -------------+                  
                 ¦ DBID     1                                ¦                  
                 +-------------------------------------------+                  
                              ¦   VEHICLES      ¦                               
                              +-----------------+                               
                                                                      
                                                                                
                                                                                
                                                                                
 Enter database number (0 - 65535 except 255) | 
Enter the database ID (DBID) of the SQL
                        					 table for which a DDM is to be created. Valid values are 0 -
                        					 65535, except 255. If you enter a 0
                        					 (zero), the database ID specified with the Natural profile parameter
                        					 UDB (see the
                        					 Parameter Reference documentation) of the NATPARM
                        					 parameter file is used. 
                     
If the specified DBID identifies an SQL database, the Select SQL Table window appears:
| 
                                                                                
 04/10/2004                       DDM Services              Library: SYSTEM     
 10:49:05               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                                +-------------+                                 
                                ¦   <CREATE>  ¦                                 
                                ¦   EMPLOYEES ¦                                 
                                ¦   PERSONNEL ¦                                 
          +-------------- Select SQL Table ---------------+                     
          ¦ Table Owner: *                                ¦                     
          ¦ Table Name : *                                ¦                     
          +-----------------------------------------------+                     
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
 Enter SQL database Table Owner (case sensitive) | 
Enter the name of the table owner and the name of the table for which a DDM is to be created.
 To specify a range: use asterisk (*) to list all tables (this
                        					 is the default setting) or use asterisk (*) notation to list particular tables,
                        					 for example, AB* selects all SQL tables with names that start with
                        					 AB.
                     
Depending on your SQL database settings, if you are accessing this SQL database for the first time in this session, the Database Logon window appears.
Enter the user ID and the password specified for the database and choose ENTER.
If the specified table exists, a DDM is created from this table.
If no such table exists or if you have specified a range of table owners and/or table names, the Import SQL Table Contents window appears from which you can select the required SQL table as shown in the example below.
| 
 04/10/2004                       DDM Services              Library: SYSTEM        
 11:18:15               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
     +--------------------- Import SQL Table Contents ----------------------+   
     ¦ Table Owner                      Table Name                    Type  ¦   
     ¦ ===================================================================  ¦   
     ¦ DEMO                             AUTOMOBILES                      T  ¦   
     ¦ DEMO                             EMPLOYEES                        T  ¦   
     ¦ DEMO                             SALARY                           T  ¦   
     ¦ SAG                              YACHT                            T  ¦   
     ¦ SAG                              ALLDATA                          T  ¦   
     +----------------------------------------------------------------------+   
                                                                                
 Select SQL table | 
Note:
A table catalog is not provided for an SQL database that is
                           					 accessed through an ODBC interface. In this case, you can only specify a table
                           					 name but not a table owner. 
                        
Press ENTER.
The DDM editor is invoked and the DDM generated from the selected table is read into the editing area.
A name is generated automatically for the DDM. It is a
                        					 combination of the table owner and the table name and cannot be changed. For
                        					 example, if the table owner's name is SAG and the table name is
                        					 TEST, the DDM name is SAG-TEST. 
                     
If the specified database is not active or cannot be accessed or if the file does not exist, a corresponding error message is issued. Nevertheless, if you press ENTER, you can still open an empty DDM editor screen, enter new field attribute definitions and save the DDM source. However, in this case you cannot check any definitions against the database file description.
If required, edit the DDM: see the section Using the DDM Editor.
After editing, press ESC and, from the MISC menu choose . See also Saving and Cataloging a DDM.
The syntax of the DDM source is checked and the DDM is saved as a source and a cataloged object.
The Natural program DDMGEN (supplied in the Natural system library SYSTEM) provides the option to generate multiple DDMs simultaneously from SQL tables without using the DDM editor.
Note:
Before you start the creation process, log on to the SQL database.
                  
 To execute DDMGEN
To execute DDMGEN
Enter the following direct command:
DDMGEN
The SQL DDM Generation screen appears where you can fill the fields required to generate a DDM from an SQL table as demonstrated in the example below:
| 
 SQL DDM Generation     
 ==================     
                        
 DDM Library  : DDMTEST 
 DDM DBID     : 210     
 Table Owner  : QA*     
 Table Name   : *       
 Replace (Y/N): N       
 | 
Enter the name of the library where you want to create the DDMs and enter the name of a table and/or specify a range as described in the previous section.
Press ENTER to execute the program.
Status messages appear at the bottom of the screen that indicate which DDM is generated from which SQL table. The DDMs generated are saved as source and cataloged objects in the specified library.
This section describes how to create a DDM from a Tamino database using the <CREATE> menu option.
 To create a DDM from a Tamino database
To create a DDM from a Tamino database
On the DDM Services screen, choose .
The DDM maintenance window appears.
From the top of the DDM maintenance window, choose .
The Select Database window appears as shown in the example below:
| 
 01/10/2004                       DDM Services              Library: SYSTEM        
 15:50:58               V 6.1.1 Pl 9  Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                 +------------- Select Database -------------+                  
                 ¦ DBID     1                                ¦                  
                 +-------------------------------------------+                  
                              ¦   EMPLOYEES_NEW ¦                               
                              ¦   PERSONNEL     ¦                               
                              ¦   VEHICLES      ¦                               
                              +-----------------+                               
                                         
                                                                                
 Enter database number (0 - 65535 except 255) | 
Enter the database ID (DBID) of the Tamino doctype for which a DDM is to be created.
 Valid values are 0 - 65535, except
                        					 255. If you enter a 0 (zero), the database ID
                        					 specified with the Natural profile parameter UDB (see the
                        					 Parameter Reference documentation) of the NATPARM
                        					 parameter file is used.
                     
If the specified DBID identifies a Tamino database, the Create XML DDM window appears:
| 
 01/10/2004                       DDM Services              Library: SYSTEM        
 15:50:58               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
                              +-----------------+                               
                              ¦   <CREATE>      ¦                               
                 +------------- Create XML DDM --------------+                  
                 ¦ FNR      1                                ¦                  
                 ¦ DDM Name                                  ¦                  
                 +-------------------------------------------+                  
                              ¦   PERSONNEL     ¦                               
                              ¦   VEHICLES      ¦                               
                              +-----------------+ | 
Enter the name to be assigned to the DDM.
The file number (FNR) of the DDM is
                        					 always 1. The file number cannot be modified.
                     
Press ENTER.
The Select Doctype window appears with a list of doctypes as shown in the example below:
| 
 01/10/2004                       DDM Services              Library: SYSTEM     
 10:55:38               V 6.1.1 Pl 9   Software AG 2004     DBID   :            
 User: SAG                                                  FNR    :            
+------------------------------------------------------------------------------+
¦   Library         DDM Maintenance           Services Profile         Quit    ¦
+------------------------------------------------------------------------------+
   +--------------------------- Select Doctype ----------------------------+    
   ¦ Doctype                 Collection              Schema                ¦    
   ¦ ===================================================================== ¦    
   ¦ SimpleContent           NATDemoData1            AttributeTest         ¦    
   ¦ SimpleContentArray      NATDemoData1            AttributeTest         ¦    
   ¦ ComplexContent          NATDemoData1            AttributeTest         ¦    
   ¦ DataType                NATDemoData1            DataType              ¦    
   ¦ DataTypeDerived         NATDemoData1            DataTypeDerived       ¦    
   ¦ Employee                NATDemoData1            Employee              ¦    
   ¦ patient                 NATDemoData1            patient               ¦    
   ¦ NatArray                NATDemoData1            NatArray              ¦    
   ¦ Array_Dim3              NATDemoData1            StoreMultiple         ¦    
   ¦ Array_Dim2              NATDemoData1            StoreMultiple         ¦    
   ¦ StoreTestSchema3        NATDemoData1            StoreMultiple         ¦    
   ¦ StoreTestSchema4        NATDemoData1            StoreMultiple         ¦    
   +-----------------------------------------------------------------------+    
                                                                                
 Select Doctype                                                                 
 | 
From the list, select a doctype and press ENTER.
The DDM editor is invoked and the DDM generated from the selected doctype is read into the editing area.
If the specified database is not active or cannot be accessed or if the file does not exist, a corresponding error message is issued. Nevertheless, if you press ENTER, you can still open an empty DDM editor screen, enter new field attribute definitions and save the DDM source. However, in this case you cannot check any definitions against the database file description.
If required, edit the DDM source: see the section Using the DDM Editor.
After editing, press ESC and, from the MISC menu choose .
The syntax of the DDM source is checked and the DDM is saved as a source and a cataloged object. See also Saving and Cataloging a DDM.