Chapter 38: Editing IMS Databases

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

Overview

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.

Opening the IMS Database Editor

You can open the IMS Database Editor by selecting either a physical database or a logical database for editing.

How to...

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 Window

The IMS Database Editor has one main window:

The IMS Database Editor 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:

Left-hand Pane

The areas on the left-hand pane of the IMS Database Editor window are described below, from the top down:

Database Tree

The Database Tree

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.

SSA List

The SSA List

Figure 38-3: The SSA List

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.

Segment Data

The Segment Data Area

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.

Right-hand Pane

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:

Layout Status Bar

The Layout Status Bar

Figure 38-5: The Layout Status Bar

The Layout Status Bar displays information about the current segment layout and divides into three parts:

Field Layout View

The Field Layout View

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.

Field Data

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

The IMS Database Editor status bar is located at the bottom of the IMS Database Editor window.

The The IMS Database Editor Status Bar

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:

  • For fixed length segments: (Fixed)
  • For variable length segments: minlength to maxlength, where minlength is the minimum segment length and maxlength is the maximum segment length.
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.

Configuring the IMS Database Editor

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.

Switching Off Warning Prompts

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.

Changing the Size of the Browse Window

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.

Navigating a Database

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.

Retrieving Data Through DL/I Calls

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.

Using SSAs to Retrieve Data

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:

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.

Searching the Database for a String

To help you search the database for a string, the IMS Database Editor provides the IMS Database Find floating bar:

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:

You can choose whether or not to make the search case-sensitive.

Notes:

Using Bookmarks to Mark Segment Occurrences

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:

Browsing Through Segment Occurrences

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:

The Browse Window

Figure 38-11: The Browse Window

While you are browsing, you can:

Notes:

Editing Data

There are three areas in which you can edit data:

Editing Area Description
Segment Data

Displays the contents of the segment buffer. The segment buffer contains character and hexadecimal representations of binary segment data for the current segment occurrence. You can edit the data in the segment buffer by clicking inside this area.

Field Layout View (Value column)

You can edit a field by clicking inside the Value column of the field. When you have finished editing a field, you can save your edits in the segment buffer by pressing Enter. This updates the Segment Data area in the left-hand pane. You can undo the edits you have made to a field by pressing Escape instead of Enter.

Field Data

You can click inside this area to edit character and hexadecimal representations of binary data for the field that is highlighted in the Field Layout View. To do so, you must have defined a segment layout for the segment occurrence.

When you have finished editing a field, you can save your edits in the segment buffer by clicking inside another part of the IMS Database Editor window.

To undo your edits, press Escape before clicking inside another part of the window.

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:

Changing Segment Occurrences

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.

How to...

Note: You cannot make changes to segment occurrences while the Browse window is open.

Adding a New Segment Occurrence

The method used to add a first child differs from the method used subsequently to add twins to the first child.

How to...

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.

Initializing Segment Occurrences

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.

Changing the Segment Length

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.

Frequently Asked Questions

This section lists a few questions that you or other users may ask.

Empty Right-hand Pane

Q?: Why is the right-hand pane of the IMS Database Editor window empty?

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.

Lost Current Segment Arrow

Q?: Why is the Current Segment Arrow not showing in the Database Tree?

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.

Unable to Add Text

Q?: Why is the IMS Database Editor ignoring the text that I type in?

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.