Chapter 37: Editing IMS Databases

This chapter describes the IMS Database Editor that Mainframe Express provides for browsing, editing and maintaining 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

For detailed instructions on using the IMS Database Editor, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, double-click IMS Option, Working with IMS databases.)

37.1 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. For this purpose, Mainframe Express provides a 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.

37.2 Opening the IMS Database Editor

You open the IMS Database Editor from the IMS View of your project. For a description of the IMS View, see the section IMS View in the chapter The IMS Option Interface.

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

Type of Database
Method
Physical database Select a DBD Gen to edit.
Logical database Select a PSB. Then, select a PCB to edit.

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.


37.3 The IMS Database Editor Window

The IMS Database Editor has one main window:



Figure 37-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:

Tips:


37.3.1 Left-hand Pane

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

37.3.1.1 Database Tree



Figure 37-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.


37.3.1.2 SSA List



Figure 37-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.


37.3.1.3 Segment Data



Figure 37-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.


37.3.2 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:

37.3.2.1 Layout Status Bar



Figure 37-5: The Layout Status Bar


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


37.3.2.2 Field Layout View



Figure 37-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.


37.3.2.3 Field Data



Figure 37-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.)


37.3.3 The IMS Database Editor Status Bar

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



Figure 37-8: The The IMS Database Editor Status Bar

This status bar displays the:

Information
Description
Length

Length of the segment, plus:

  • For fixed length segments: (Fixed)

  • For variable length segments: minlength to maxlength, where minlength is the minumum 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.

37.4 Configuring the IMS Database Editor

You can configure the IMS Database Editor by:

To change these configurations, click Data Tools on the Options menu and then click the IMS tab on the Data Tools dialog box.

37.4.1 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 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.

37.4.2 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 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.

37.5 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.

37.5.1 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 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.


37.5.1.1 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.

37.5.2 Searching the Database for a String

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



Figure 37-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:


37.5.3 Using Bookmarks to Mark Segment Occurrences

You can navigate your way forwards but not backwards through the database. To aid navigation, the IMS Database Editor provides 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:


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

37.6 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:



Figure 37-11: The Browse Window

While you are browsing, you can:


Notes:

Tip: You can customise the number of segment occurrences displayed per page. For more information, see the section Configuring the IMS Database Editor.


37.7 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.

Whilst 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:


37.8 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.

Full instructions on how to add, modify and remove segment occurrences are given in the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, double-click IMS Option, Working with IMS databases, Changing Segment Occurrences.)


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


37.8.1 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. For detailed instructions, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, double-click IMS Option, Working with IMS databases, Changing Segment Occurrences.)

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.

37.8.2 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 may prefer to use the Select Layout and Initialize option to select a different layout.

37.8.3 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.

37.9 Frequently Asked Questions

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

37.9.1 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.

37.9.2 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.

37.9.3 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 © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.