This chapter describes the IMS Database Editor that you can use to browse, edit and maintain Information Management System (IMS) databases through a graphical interface. The editor is useful in a test environment for editing records in a test database.
You can use the IMS Database Editor with
The IMS Database Editor provides a graphical interface for viewing and manipulating data in an IMS database. You can:
When you have finished editing a local database, your edits are saved automatically when you close the database.
Note: To view and edit formatted data, you must first of all define segment layouts for the segment types in the database. To do this you use the Segment Layout Editor. To find out more about the Segment Layout Editor, see the chapter Defining Segment Layouts for IMS Databases.
The rest of this chapter assumes that you have segment layouts loaded to format your data.
You can open the IMS Database Editor by selecting either a physical database or a logical database for editing.
When you open the IMS Database Editor, the IMS Database Editor Window opens.
Note: To prevent segments being locked unnecessarily, a segment occurrence is not loaded automatically for editing when you open the IMS Database Editor. Therefore, you should make one or more DL/I calls to establish your position.
The IMS Database Editor has one main window:
Figure 38-1: The IMS Database Editor Window
This window is divided into a left-hand pane and a right-hand pane. At the bottom of the window, there is a status bar. Above the window is the IMS Database Editor toolbar.
Notes:
The areas on the left-hand pane of the IMS Database Editor window are described below, from the top down:
Figure 38-2: The Database Tree
The Database Tree shows the structure of the database by displaying the hierarchy of segment types.
The Current Segment Arrow marks the current position in the hierarchical path.
To expand a segment type, click . To compress a segment type, click .
Notes:
While you are browsing, a Browse window overlays the Database Tree.
The SSA List displays a list of segment types from the current segment type up to the root. Each row shows the:
While you are browsing, a Browse window overlays the SSA List.
Figure 38-4: The Segment Data Area
The Segment Data area displays character and hexadecimal representations of binary data for the current segment occurrence. When a segment layout is loaded, the key area is highlighted in red.
Note: If you click in the Database Tree on a segment type that is not marked by the Current Segment Arrow , the Segment Data area displays EBCDIC padding bytes.
The right-hand pane of the IMS Database Editor window is empty unless there is a segment layout associated with the current segment. For more information about segment layouts, see the chapter Defining Segment Layouts for IMS Databases.
The areas on the right-hand pane are described below, from the top down:
Figure 38-5: The Layout Status Bar
The Layout Status Bar displays information about the current segment layout and divides into three parts:
Layout Status Icon | Indicating |
---|---|
The current segment layout is a default layout | |
The current segment layout is a conditional segment layout | |
There is a warning associated with the current segment layout. The layout status message, also included in the Status Bar, provides more information. | |
A layout is not currently loaded. The layout status message, also included in this Status Bar, provides more information. |
For a default layout, the layout name displays as "DEFAULT". For a conditional layout, the layout name displays the name of the COBOL layout used to create the layout.
Figure 38-6: The Field Layout View
The Field Layout View uses a COBOL segment layout to display the field name, picture and value for each field in a segment occurrence. Key fields are displayed in red.
You can resize the columns by dragging the column dividers on the column headings row.
If the data displayed is for the segment occurrence at your current position in the database, you can edit the data in a field by clicking inside the Value column of the field.
You can click a field in the Field Layout View to display unformatted data for that field in the Field Data area.
Figure 38-7: The Field Data Area
The Field Data area displays character and hexadecimal representations of binary data for the field or group item that is currently highlighted in the Field Layout View.
To display data for a particular field, click on the field in the Field Layout View.
Note: If you click in the Database Tree and highlight a segment type that is not marked by the Current Segment Arrow , the right-hand pane does not continue to display data for the current segment occurrence. Instead, the data fills with EBCDIC padding bytes and a layout is chosen according to this data and the segment type. (The IMS Database Editor always works in EBCDIC and therefore ignores the Data Tools option for changing the ANSI/EBCDIC character setting.)
The IMS Database Editor status bar is located at the bottom of the IMS Database Editor window.
Figure 38-8: The The IMS Database Editor Status Bar
This status bar displays the following information:
Information | Description |
---|---|
Length |
Length of the segment, plus:
|
PROCOPTS | PROCessing OPTionS: The access control that the application has for the current segment. |
Segment | Name of the current segment type. |
Level | Level within the hierarchy of the current segment type. |
Status Code |
Status code for the last DL/I call. To indicate success, the IMS Database Editor displays the word BLANKS. |
You can configure the IMS Database Editor by:
To change these configurations, click Data Tools on the Options menu then click the IMS DB Editor tab on the Data Tools Options dialog box.
Before using the IMS Database Editor, you might like to consider whether you want to be prompted every time you attempt to edit or delete a segment occurrence. For both operations, by default, the IMS Database Editor displays a prompt asking you if you want to continue.
By deselecting Update warning and Delete warning in the Data Tools Options dialog box, you specify that the IMS Database Editor does not display these prompts. Any changes that you make to these settings take effect when you next open a database. If you do switch either of the prompts on or off, make sure that you inform anyone else who uses the IMS Database Editor on your PC.
By default, the Browse window displays a predefined number of segment occurrences per page. You can change this default by entering a new value in the Number of segments per browser page field in the Data Tools Options dialog box.
You might find that you want to reduce the number of segment occurrences per page. For example, if you are accessing a remote database or using a slower machine, the Browse window may be taking too long to update when you ask to view the next page of occurrences. To obtain a quicker response, you can reduce the number of segment occurrences per page.
For more information on browsing, see the section Browsing Through Segment Occurrences.
There are several ways to navigate the database inside the IMS Database Editor. You can use:
In addition, you can move your position to another segment occurrence while you are browsing. For more information on browsing, see the section Browsing Through Segment Occurrences.
To retrieve segment occurrences, you can make the following DL/I calls:
When you use a DL/I call to change your position within a database, the Current Segment Arrow in the Database Tree moves to the new segment type, if this has changed. The Field Layout View and the Segment Data and Field Data areas display data for the segment occurrence that is now current.
When you reach the end of the database, the IMS Database Editor prompts you to reset your position to the start of the database.
Tip: To find out whether a DL/I call is successful, look at the status code on the IMS Database Editor status bar. The status code should be set to BLANKS. If there is an error, the IMS Database Editor displays a message containing the status code and a full description. See the section The IMS Database Editor Status Bar for more information.
The SSA List shows all the segment types on the path, together with any SSAs already set up for those segment types. You can define an unqualified or qualified SSA for a segment type by double-clicking on the segment type in the SSA List:
To identify the next segment type that you want to access, you can use an unqualified SSA with one of the following SSA command codes:
You cannot choose the command codes *F or *L for a segment type that has unique keys defined.
You can use qualified SSAs to narrow your search down further to individual segment occurrences. For example, an insurance company might want to search for all policies taken out after a certain date.
You can define an SSA for each segment type up the path back to the root segment, as long as each of those segment types has a key. For each segment type, you can define:
These are the same command codes that you can set up for an unqualified SSA.
Figure 38-9: The Definition of an SSA Qualification Statement
Each SSA qualification statement is made up of a:
You can combine unqualified and qualified SSAs on a single call. The IMS Database Editor remembers the SSAs that you create for up to 10 databases.
To help you search the database for a string, the IMS Database Editor provides the IMS Database Find floating bar:
Figure 38-10: The IMS Database Find Floating Bar
The search begins from your current position in the database. You can search the rest of the database or you can restrict the search to:
This option is not relevant for the root segment.
You can choose whether or not to make the search case-sensitive.
Notes:
You can navigate your way forwards through a database. To aid navigation, the IMS Database Editor includes a bookmarking utility: you can bookmark the current segment occurrence, then later on in the session or in a later editing session you can return to the bookmarked segment occurrence.
Bookmarking offers options to:
When you add a bookmark, the IMS Database Editor makes a note of the segment type. You can also provide a more meaningful description for the segment occurrence you are bookmarking. The editor records the segment name and your description in a bookmark list.
Notes:
Between editing sessions, the IMS Database Editor stores your bookmark list automatically in a bookmark file in the DATA folder of the project folder. The bookmark file has a .bmf extension.
The filename of the bookmark file depends upon the type of database you are editing:
Type of Database | Bookmark List Filename |
---|---|
Physical database | The name of the DBD |
Logical database | The name of the PSB immediately followed by n, where n is the PCB number |
The bookmark list displays your saved bookmarks in the order in which you created them. When you select a bookmark from the list, the IMS Database Editor changes your current position to the bookmarked segment occurrence.
You can delete a bookmark that you no longer wish to keep in a bookmark list.
You can elect to save your bookmark list in a bookmark file on a different drive, changing the directory and filename if you want.
You can retrieve a bookmark list from a bookmark file that is not the default bookmark file.
You can browse forwards through the segment occurrences in a database, starting at your current position. The Start of browse position marks your current position.
The Browse window overlays the Database Tree and SSA List. The window lists segment occurrences one page at a time:
Figure 38-11: The Browse Window
While you are browsing, you can:
Notes:
There are three areas in which you can edit data:
While editing, you can:
When you have finished editing fields for the segment occurrence, you can issue an ISRT or REPL call. You can undo segment buffer edits up until the point when you issue the ISRT or REPL call.
Notes:
You can make the following DL/I calls to add, modify and delete segment occurrences:
DL/I Call | Function |
---|---|
ISRT | Add a new segment occurrence. See the section Adding a New Segment Occurrence |
REPL | Modify an out-of-date segment occurrence |
DLET | Remove a redundant segment occurrence |
If a segment is of variable length, you can also change the segment length.
Before issuing ISRT and REPL calls, you need to edit data. For more information on editing, see the section Editing Data.
Note: You cannot make changes to segment occurrences while the Browse window is open.
The method used to add a first child differs from the method used subsequently to add twins to the first child.
Once you have added the first child, you can add a twin very quickly. While the data for the previous twin is still in the segment buffer, you can edit the key field and any other fields that are different and click .
Before clicking , you must edit any key fields to make them unique.
The IMS Database Editor provides two options for initializing segment occurrences:
Option | Description |
---|---|
Initialize | Initialize the data in the segment buffer. As you enter new data, the IMS Database Editor loads the appropriate layout automatically. |
Select Layout and Initialize | Specify the layout you want to use for the new segment occurrence and initialize the data in the segment buffer. |
By default, the editor applies a default segment layout when you initialize. Although the Initialize option is quicker because you do not specify additional options, you might want to use the Select Layout and Initialize option to select a different layout.
If you have a segment layout loaded for the current segment occurrence, you can edit the length field of a variable length segment occurrence.
If you do not have a segment layout loaded, you cannot edit the length field since there is no formatted data to edit. Instead, you can use a utility that the IMS Database Editor provides for changing the segment length.
This section lists a few questions that you or other users may ask.
A. The IMS Database Editor could not find a segment layout to match this particular segment occurrence. For more information, look in the Layout Status Bar at the top of the right-hand pane.
To find out about creating segment layouts, see the chapter Defining Segment Layouts for IMS Databases.
If you have created segment layouts already for the segment type, they may all be conditional. Make sure that you create a default layout for each segment type. Then, if none of the conditional segment layouts applies to a segment occurrence, that segment occurrence can adopt the default layout.
A. This indicates that you do not currently have your position in the database established.
When you open the IMS Database Editor, you are not positioned in the database until you make a DL/I call. Another reason for losing is that you have made a failed ISRT call.
To display in the Database Tree, you should make a DL/I call to position yourself in the database.
A. This occurs when you are editing a field in the Segment Data area that is already full. If the IMS Database Editor did allow you to insert text, data would be lost off the end of the field. This also occurs when you are are editing an alphanumeric field.
You should switch back to Overtype mode by pressing Insert.
Copyright © 2006 Micro Focus (IP) Ltd. All rights reserved.