The DDM editor is organized in a table where the field definition data is contained in rows and columns. The editor provides a separate row for each field defined for a DDM. All attribute definitions that belong to a field are contained in the cells of this row.
You can add a new field to a DDM source or modify the attributes of an existing field by using one of the following methods:
Enter each attribute definition in the respective cell of a field row or replace existing definitions.
Copy fields from the current database file if available.
Copy fields within a DDM or from another DDM by using copy and paste functionality.
This section describes the columns contained in the DDM editor window and the functions provided to create or modify a DDM field, change the display of the DDM editor window, rearrange columns, or hide fields that are not required for a current editing operation.
This section describes the fields contained in the DDM Header dialog box that are used to display and change the correlation between the database and the DDM.
The information contained in the DDM Header dialog box is similar to the information displayed in the status bar. For details on the status bar, refer to Status Bar in the Using Natural Studio documentation. You can switch the status bar on or off by setting the corresponding DDM editor option as described in the Using Natural Studio documentation.
To display and modify DDM header fields
In the active DDM editor window, choose
. from the menu.Or:
Choose the
toolbar button.
The DDM Header dialog box appears with the name of the current DDM displayed at the top of the box:
From the Database ID combo box, choose an ID, or enter an ID in the box: see also Database ID in Explanation of DDM Header Fields.
In the File ID text box, enter a new value: see also File ID in Explanation of DDM Header Fields.
In the Default sequence text box (not applicable to Tamino), enter a short name as default sequence: see also Default sequence in Explanation of DDM Header Fields.
For Tamino, the DDM Header dialog box also displays read-only doctype information as shown in the example below:
Choose
to save the new values.The fields contained in the DDM header are described in the following table. For the Tamino-specific doctype fields, see also Introducing Tamino XML Schema Language in the Programming Guide.
Header Field | Description |
---|---|
Database ID |
The database ID (DBID) as specified in the global configuration file. DBID contains the database file referenced by the DDM. Valid range: See also: DBMS Assignment and Database Management in the Configuration Utility documentation. If |
File ID | The number of the file being referenced in the
database
The file number of a DDM from Tamino is
always Valid range: |
DDM | The name of the DDM currently contained in the work area of the DDM editor. |
Default sequence | Not applicable to
Tamino.
The default sequence by which the file is read when it
is accessed with a The default sequence is specified with the two-character field short name. The system validates the short name based on the selected file number. If the database is accessible, the short name is checked against the corresponding field in the database file. If such a field does not exist in the database, a selection list of valid short names is displayed. If the database cannot be accessed, no selection list is generated. |
Type | The type of database. |
Collection | Read-only Tamino-specific doctype information.
The name of the collection which is used within the Tamino database. |
Schema | Read-only Tamino-specific doctype information.
The name of the Tamino XML schema which is used within the Tamino database. |
Doctype | Read-only Tamino-specific doctype information.
The name of the doctype within the collection. |
Namespace URI |
Read-only Tamino-specific doctype information.
The list of namespace URI/prefix pairs which corresponds to the doctype. |
You can use the
option to list or specify Adabas files that are physically coupled to a DDM.To list or specify a coupled file
In the active DDM editor window, from the
menu, choose .Or:
Choose the
toolbar button.
The File Coupling dialog box appears as shown in the example below:
All files coupled to the current DDM are listed together with the short names of the descriptors used for coupling.
In the File Name text box, enter the name of the file to be coupled to the DDM.
In the File Number text box, enter the number of the file to be coupled to the DDM.
In the From text box, enter the field short name, at which the file coupling begins.
In the To text box, enter the field short name, at which the file coupling ends.
Choose
to add the defined entry to the list box.Or:
Choose to remove the selected
entry from the list box.
For further information on physical file coupling, refer to the Adabas documentation.
This section describes the field attributes that can be defined in the rows and columns of the DDM editor window.
The display of the columns depends on whether a column is relevant for the DDM being edited. For example, Tamino-specific information is not displayed for a DDM created from an Adabas database.
Column Heading | Field Attribute | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
None |
|
||||||||||||||||||||||||||||||||||||
Type |
|
||||||||||||||||||||||||||||||||||||
Level | The level number assigned to the field.
Levels are used to indicate the structure and grouping of the field definitions. This is relevant with view definitions, redefinitions and field groups (see the relevant sections in the Programming Guide). Valid level numbers are For Tamino: valid level numbers are
Level numbers must be specified in consecutive ascending order. |
||||||||||||||||||||||||||||||||||||
Short Name | Not applicable to Tamino.
The Short Name column displays the two-character short name of the corresponding field in the database file. In a remote environment: The two-character code used for segment types in DL/I. Creating Fields:
If you create a new DDM field and the display of the Short Name column is switched off, the DDM editor assigns to the new field a new short name that has not yet been used for another field. This means that for the new field there is no correlation between the database file and the DDM. To guarantee that the short name of a new field is checked against the database, create a field by using the function as described in Inserting and Modifying Fields. |
||||||||||||||||||||||||||||||||||||
Name | The name of the field.
It can be 3 - 32 characters long for Adabas fields and 1 - 32 characters for SQL columns and Tamino doctypes. In a remote environment on a mainframe platform, the name can be 1 - 19 characters long for DL/I fields. The rules to create a name comply with the
naming
conventions for user-defined variables (see the
Using Natural Studio documentation),
except that the first character of the name must always be a Latin capital
letter (A - Z). In addition, the name must not start with The field name is the name used in other Natural objects (for example, in a program) to reference the field. The field name is unique across the whole DDM. For Tamino, the field name is not necessarily the same name as Tag Name (see Tamino-Specific Extended Field Attributes). |
||||||||||||||||||||||||||||||||||||
Format | The Natural data format of an elementary field, such as
A (alphanumeric), P (packed numeric) or
L (logical).
For valid Natural data formats, refer to Format and Length of User-Defined Variables in the Programming Guide. To modify the format of a field, see also the explanations in Inserting and Modifying Fields. |
||||||||||||||||||||||||||||||||||||
Length |
|
||||||||||||||||||||||||||||||||||||
Suppression |
|
||||||||||||||||||||||||||||||||||||
Descriptor |
|
||||||||||||||||||||||||||||||||||||
Header | The header to be produced for each field specified in a
DISPLAY statement: see
Specifying Extended Field
Attributes.
|
||||||||||||||||||||||||||||||||||||
Edit Mask | The edit mask to be used: see Specifying Extended Field Attributes. | ||||||||||||||||||||||||||||||||||||
Remarks | A comment which applies to a field and/or the DDM. | ||||||||||||||||||||||||||||||||||||
Tag Name | Tamino-specific information as described in Tamino-Specific Extended Field Attributes. | ||||||||||||||||||||||||||||||||||||
XPath | |||||||||||||||||||||||||||||||||||||
Occurrence | |||||||||||||||||||||||||||||||||||||
Flags | |||||||||||||||||||||||||||||||||||||
Default Value | |||||||||||||||||||||||||||||||||||||
Fixed Value | |||||||||||||||||||||||||||||||||||||
SQLTYPE | SQL-specific information as described in SQL-Specific Extended Field Attributes. |
An indicator field is used to retrieve the length of a variable
length field or information about the data significance (NULL
value indicator) of a database field. An indicator field does not
provide the contents of a database field.
A database field name starting with L@
or N@
is interpreted as an
indicator field, according to the indicator specified in
the NATCONV.INI configuration file (see also
IDENTIFIER-VALIDATION
in
How to Use
Different Character Sets in the
Operations documentation. Therefore, a database
field name must not start with any of these character strings unless it
represents an indicator field.
The following happens when a DDM is initially generated.
An L@xxxxx
field is
automatically added for every variable length field, where
xxxxx
is the name of the related field.
This applies to long alpha (LA) and large object (LB) fields in an Adabas file.
If the length indicator relates to an LA, LB or LOB field, the Natural data format/length must be I4. For a VARCHAR field, the format/length must be I2.
An N@xxxxx
field is
automatically added for a field that may contain a NULL
value,
where xxxxx
is the name of the related
field.
This applies to Adabas fields defined with the SQL Null Value
Option. The Natural data format/length of a NULL
indicator field must be I2.
Before you perform an editor function, you select (highlight) the row or row cell where you want to create, modify or delete a field.
To select a single field if a cell is selected
Press SHIFT+SPACEBAR.
The field row of the cell is selected.
Or:
Click on the leftmost column of the field row you want to
select.
The specified field row is selected.
To select a single field if a row is selected
Click on the field row you want to select.
Or:
Navigate to the field row you want to select by pressing
UP-ARROW, DOWN-ARROW, HOME or END.
The specified field row is selected.
To select a range of fields if a cell is selected
Press SHIFT+SPACEBAR.
The field row of the cell is selected.
Or:
Click on the leftmost column of the first field row in the
range.
The specified field row is selected.
Hold down SHIFT while you select the row of the last field in the range.
The rows of the specified field range are selected.
To select a range of fields if a row is selected
Click on the leftmost column of the first field row in the range.
Or:
Navigate to the first field row in the range by pressing
UP-ARROW, DOWN-ARROW, HOME or
END.
The first field row in the range is selected.
Hold down SHIFT while you select the row of the last field in the range.
The rows of the specified field range are selected.
To select all fields
From the
menu, choose .Or:
Choose the
toolbar button.
Or:
Press CTRL+A.
All field rows contained in the current DDM source are selected.
To select a field attribute if a cell is selected
Click on the row cell where you want to add or modify an attribute.
Or:
Navigate to the row cell where you want to add or modify an
attribute by pressing TAB, SHIFT+TAB,
UP-ARROW, DOWN-ARROW, LEFT-ARROW,
RIGHT-ARROW, HOME or END.
The specified row cell is selected.
To select a field attribute if a row is selected
Press F2.
The leftmost cell of the field row is selected.
Or:
First, click on the row that contains the cell you want to
select and then click on the cell where you want to add or modify an
attribute.
The specified row cell is selected.
This section provides instructions for adding fields into a DDM source or modifying fields within a DDM source.
To insert a field from the current database file
Select the row where you want to place the new field.
The insert position (before or after the selected field) of the new field depends on the current setting of:
The
toolbar button.The Insert before/Insert after editor option (see: DDM Editor Options in the Using Natural Studio documentation).
From the
menu, choose .Or:
Choose the
toolbar button.
Or:
Select a row and press INS, or select a cell in the
last row and press DOWN-ARROW.
If you are editing a DDM that references fields in the database file, the Field Selection List dialog box appears as shown in the example below:
From the Field Selection List dialog box, select a field.
The new field is pasted into the DDM source either before or after the field selected in Step 1.
If you are editing a DDM that cannot reference the corresponding fields in the database file, a blank row is inserted before or after the selected field.
Note:
You cannot validate new field attributes if the
database is not available. See also the
Creating
Fields note for column Short Name in
the section Field Attribute Definitions.
In any blank row cell, you can enter a value for the field attribute to be added or choose a value from a selection box depending on the type of field you want to define.
When you insert a field of the type group or periodic group, the level of each subsequent field is automatically incremented properly.
To modify a field
Select the row cell that contains the field attribute definition you want to change and either overwrite the existing value or choose a value from a selection box.
When you modify the level of a field of the type group or periodic group, the level of each subsequent field is automatically incremented or decremented properly, depending on the new level value.
When you modify the Natural data format of a field, the current length is kept if it is also valid for the new data format. Otherwise, the current length specification is automatically replaced by a valid default length (see also the description of the Length column).
The copy/cut and paste functions of the DDM editor are used to copy, move or delete one or more fields within the current DDM source or between different DDM sources.
To copy or cut and paste fields
Select the fields to be copied or cut.
From the
menu, choose or .Or:
Choose the or
toolbar button.
Or:
Press CTRL+C or CTRL+X.
The fields are placed on the clipboard and can be pasted into the current DDM source or in another DDM source.
If the fields are to be pasted into another DDM, open the appropriate DDM source.
Select the field before or after which the copied or cut fields are to be pasted (see also the insert position in To insert a field).
From the
menu, choose .Or:
Choose the toolbar button.
Or:
Press CTRL+V.
The copied or cut fields are pasted into the current DDM source at the specified position.
To paste the same fields again, repeat Steps 3 through 5.
When you cut or paste a field of the type group or periodic group, the level of each subsequent field is automatically adjusted properly.
The search function is used to search for field names and replace field names in the current DDM source.
The find function is performed on all data definitions including collapsed blocks of fields (see also Showing or Hiding Fields).
Caution:
There is no undo function available to restore original
names.
To search for a DDM field name
From the
menu, choose .Or:
Choose the
toolbar button.
Or:
Press CTRL+F.
The Find DDM Field dialog box appears as shown in the example below:
In the Find field name text box, enter
the long name of the field for which to search (in the example above:
PERSONNEL-ID
).
Set the Match whole words only check box if you want to find whole field names only and not parts of field names. If the box is not set, all instances of the search string will be found.
In the Direction section, set the option button Up or Down to specify whether the search is to be performed from the cursor position to the end of the DDM source or from the cursor position to the beginning of the DDM source. The default setting is Down.
Choose
.If no instance of the search string is found, an appropriate message is displayed.
If an instance of the search string is found, it will be selected.
To search for additional instances of the search string:
from the
menu, choose .Or:
Press F3.
Or:
Choose the
toolbar button.
To replace a field name
From the
menu, choose .Or:
Choose the
toolbar button.
Or:
Press CTRL+H.
The Replace DDM Field dialog box appears as shown in the example below:
In the Find field name text box, enter a search string.
In the Replace with text box, enter a replacement string.
Set the Match whole words only check box if you want to find whole field names only and not parts of field names. If the box is not set, all instances of the search string will be found.
In the Direction section, set the option button Up or Down to specify whether the search is to be performed from the cursor position to the end of the DDM source or from the cursor position to the beginning of the DDM source. The default setting is Down.
Choose
to replace the next hit found in the source.Choose
and to find the next hit and replace it.Or:
Choose the
and
toolbar buttons.
Or:
Choose
to replace the next hit found without selecting the hit
first.
Or:
Choose to replace all
search strings found.
If no instance of the search string is found, an appropriate message is displayed.
Choose
to exit the dialog box.When a field is deleted, it is cut from the DDM source but is not placed on the clipboard. Once deleted, the field can no longer be recovered.
To delete fields from the DDM editor
Select the field(s) you want to delete.
From the
menu, choose .Or:
Choose the
toolbar button.
Or:
Press DEL.
The fields are deleted from the DDM source and cannot be recovered.
When you delete a field of the type group or periodic group, the level of each subsequent field is automatically decremented properly.
In the editor window, you can adjust the display of the DDM to your needs by resizing, moving or hiding columns that are not required for an editing operation in the current DDM.
You can automatically adjust a single column or all columns to the best size, or change the width of a single column to a specific size.
To resize all columns to best fit
Choose one of the following methods:
Select a field as described in Selecting Single Fields.
Or:
In any column heading, click the right
mouse button and choose from the
context menu.
The Customize Columns dialog box appears.
Select the Best Fit check box. This option is not selected by default.
All columns in the active editor window are automatically resized to the size that best fits into the editor window whereby the column headings always remain visible.
Or:
Press CTRL+PLUS.
Or:
If you want to apply Best Fit to all
active editor windows, set the corresponding editor option described in
DDM Editor
Options in the Using Natural Studio
documentation.
To resize all columns to best fit while typing in text
Open the Customize Columns dialog box as described in To resize all columns to best fit.
Select the Best Fit check box and, additionally, select the Auto Fit check box.
Each column in the active editor window is then automatically adjusted to fit the text you type in a row cell or a Definition dialog box when you leave the column or dialog box respectively.
Or:
If you want to apply Best Fit and
Auto Fit to all active editor windows, set the
corresponding editor options described in
DDM Editor
Options in the Using Natural Studio
documentation.
To resize a single column to fit the contents
In the heading of the column you want to change, place the pointer over the right border. When the pointer changes to a divider, double-click on the border between the column headings. Note that you cannot resize the leftmost column.
The column is automatically adjusted to fit its contents.
To resize a single column to a specific size
In the heading of the column you want to change, place the pointer over the right border. When the pointer changes to a divider, drag the divider to the width you require. Note that you cannot resize the leftmost column.
The width of the column has changed to the specified size.
To save a resized table layout
Open the Customize Columns dialog box as described in To resize all columns to best fit and choose one of the following buttons.
saves the new table layout for the current editor session.
saves the new layout in your user profile and retains it for future editor sessions.
overwrites the current layout with the layout previously saved in the user profile. Choose to save this layout.
followed by overwrites the layout saved in the user profile with the default layout initially provided by the editor. Choose to save this layout.
Or:
In the editing area of the editor window, press
CTRL+ALT+L.
The new layout is saved in your user profile and retained for future editor sessions.
You can change the table layout by moving single or multiple columns.
To move a column
Choose one of the following methods:
Select a field as described in Selecting Single Fields.
Open the Customize Columns dialog as described in To resize all columns to best fit.
From the Displayed Columns list box, select the columns you want to move and choose or (if required repeatedly) until the columns have reached the target position.
The top-to-bottom order of the list box corresponds to the left-to-right of the table in the editor window, that is, the top list column corresponds to the leftmost table column.
Or:
Drag the column heading you want to move and drop it in the position required. Note that you cannot move the leftmost column.
Open the Customize Columns dialog box as described in To resize all columns to best fit.
To keep the new table layout, proceed as described in To save a resized table layout.
You can change the table layout by hiding or displaying columns.
To hide a column by rearranging the display order
Select a field as described in Selecting Single Fields.
Open the Customize Columns dialog box as described in To resize all columns to best fit.
From the Displayed Columns list box, select the columns you want to hide.
The top-to-bottom order of the list box corresponds to the left-to-right of the table in the editor window, that is, the top list column corresponds to the leftmost table column.
Note:
You cannot select Type,
Level, Name,
Format and Length which are mandatory
for the table layout.
Choose
.The selected columns are removed from Displayed Columns and appear in the Hidden Columns list box.
To keep the new table layout, proceed as described in To save a resized table layout.
To hide a column by moving column borders
In the heading of the column you want to hide, place the pointer over the right border. When the pointer changes to a divider, drag the divider to the left border until the column heading is completely invisible (right and left border lines must coincide).
Note:
You cannot hide the columns Type,
Level, Name,
Format and Length which are mandatory
for the table layout.
The hidden column then appears in the Hidden Columns list box of the Customize Columns dialog box.
To keep the new table layout, proceed as described in To save a resized table layout.
To display a hidden column
Select a field as described in Selecting Single Fields.
Open the Customize Columns dialog box as described in To resize all columns to best fit.
From the Hidden Columns list box, select the columns you want to display in the editor window.
Choose
.The selected columns are removed from Hidden Columns and appear in the Displayed Columns list box.
To keep the new table layout, proceed as described in To save a resized table layout.
You can show (expand) or hide (collapse) blocks of fields to improve readability and maintainability of DDMs with complex data structures. When a block of fields is collapsed, all fields contained in this block are hidden, including any other nested blocks if they are part of the chosen block. Hidden blocks retain their collapsed or expanded state.
Blocks that can be expanded or collapsed are blocks of fields that are defined for the same field level (1 to 99). Blocks are expanded or collapsed by the hierarchy of levels, from highest level 1 to lowest level 99. A block that contains fields from a lower-ranking level is contained in a block from a higher level.
When scanning field definitions (see also Finding and Replacing Fields), collapsed blocks are also scanned.
If you want to expand and collapse blocks of fields, you need to set the appropriate editor option referenced in the instructions below.
To expand and collapse single blocks
Set the Expand/Collapse editor option as described in DDM Editor Options in the Using Natural Studio documentation.
When the Expand/Collapse option is set, an expand or a collapse toggle ( or ) appears as shown in the example below:
The toggle indicates the first row of a collapsed block.
The toggle indicates the first row of an expanded block.
Click on a toggle to expand a block or click on a toggle to collapse a block.
Or:
Position the cursor in a row that contains a
or
toggle and, from the menu, choose
or choose the
toolbar button.
Or:
Use any of the shortcut keys listed in
Shortcut
Keys in the Using Natural Studio
documentation.
To expand or collapse all blocks
From the
menu, choose or .Or:
Choose the
or the
toolbar button.
The extended field editing function provides the option to specify default field attributes for headers and edit masks as well as remarks to be applied when the field is used in another Natural object (for example, in a program).
The header attribute specifies the default column header to be
displayed above the field when it is output, for example, with a
DISPLAY
statement.
If no header
is specified, the field name is used as column header.
The edit mask attribute specifies the default edit mask to be used
when the field is output, for example, with a DISPLAY
statement. The edit
mask must conform with Natural syntax rules and be valid for the Natural data
format and length of the field.
The remark attribute specifies a comment about the field.
For Tamino, the extended field editing function also provides additional Tamino-specific information.
EM - Edit Mask in the Parameter Reference documentation
EMU - Unicode Edit Mask in the Parameter Reference documentation
The section below covers the following topics:
This section describes how to display and edit the extended attributes of the fields contained in the current DDM.
To display and edit extended field attributes
In the active DDM editor window, select a field.
From the
or context menu, choose .Or:
Choose the
toolbar button.
The Extended Attributes dialog box appears with the name of the selected field as shown in the example below:
If a header exists for the selected field, it is displayed in the Header text box. You can edit the header, or add a header if none exists.
If an edit mask exists for the selected field, it appears in the Edit mask text box. You can modify the edit mask, or add an edit mask if none exists.
If a remark exists for the selected field, it appears in the Remarks text box. You can edit the remark, or add a remark if none exists.
For Tamino, Tamino-specific extended field attributes are displayed as shown in the example below:
Choose
to save and validate any changes you have made for the current field.Choose
to view and edit extended attributes for the next field in the DDM source.Or:
Choose to view and
edit extended attributes for the previous field in the DDM source.
(Commentary fields identified with an asterisk (*) are skipped.)
Choose
to save and validate all field modifications.The DDM editor window appears.
Tamino-specific extended field attributes are extracted from Tamino XML schema definitions.
In addition to the text boxes Header, Edit Mask and Remarks, the following read-only Tamino-specific attributes are displayed in the Extended Attributes dialog box:
In addition to the text boxes Header, Edit Mask and Remarks, the following read-only SQL-specific attribute is displayed in the Extended Attributes dialog box:
Attribute | Function |
---|---|
SQLTYPE | Information generated from the data types BLOB (Binary Large Object) or CLOB (Character Large Object) if contained in an Oracle database. |
This section describes how to display and edit the extended field attributes of a DDM generated from a VSAM file.
Extended Editing at Field Level - Natural for VSAM documentation.
To display and edit extended field attributes
In the active DDM editor window, select a field.
From the
menu, choose .Or:
Choose the
toolbar button.
The Extended Attributes dialog box appears with the name of the selected (current) field indicated at the top of the window as shown in the example below:
If a header exists for the selected field, it is displayed in the Header text box. You can modify the header, or add a header if none exists.
If an edit mask exists for the selected field, it appears in the Edit mask text box. You can modify the edit mask, or add an edit mask if none exists.
If a remark exists for the selected field, it appears in the Remarks text box. You can modify the remark, or add a remark if none exists.
If an alternate descriptor (Type A) or superdescriptor (Type X) is defined for the field, you can enter an alternative index name.
If the field is a multiple or periodic group field, you can specify the number of occurrences in the Maximum Occurrence text box.
If an alternate descriptor (Type A) or superdescriptor (Type X) is defined for the field, you can set the flags Upgrade, Unique Key, Sort and Null.
If the field has a primary or secondary key descriptor (Type A) or superdescriptor (Type X), you can select the field short name from the Redefinition of field combo box.
Choose
to save and validate any changes you have made for the current field.Choose
to view and edit extended attributes for the next field in the DDM source.Or:
Choose to view and
edit extended attributes for the previous field in the DDM source.
(Commentary fields identified with an asterisk (*) are skipped.)
Choose
to save and validate all field modifications.The DDM editor window appears.
This section describes how to display the definition of a descriptor
of type H
(hyperdescriptor), P
(phonetic descriptor)
or S
(subdescriptor or superdescriptor). For further information
on descriptors, see Descriptor in the
section Columns of Field Attributes.
To display descriptor definition
In the DDM editor window, select the row or row cell that
contains S
, P
or H
.
From the
or context menu, choose .Or:
Choose the
toolbar
button.
The Descriptor Information dialog box appears as shown in the example below:
The definition of the descriptor is displayed (in the example
above: DEPT
and NAME
) next to Field
Name and the field offsets are displayed next to
Begin and End.
Choose Descriptor Information dialog box.
to exit the