Previous Developing IMS Applications Defining Segment Layouts for IMS Databases Next"

Chapter 36: 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.)

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

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


36.3 The IMS Database Editor Window

The IMS Database Editor has one main window:



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


36.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:

Area
Description
Database Tree



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

  • When you first open the window, is not displayed. This is because you have yet to establish your current position in the database.

  • You can click and highlight a segment type that is not marked by , but this does not change your position in the database.


While you are browsing, a Browse window overlays the Database Tree.


SSA List



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

  • Level of the segment within the hierarchy
  • Name of the segment
  • SSAs that you have set up for the segment, if any
  • Key feedback returned from the last call
  • Number of bytes in the segment

While you are browsing, a Browse window overlays the SSA List.


Segment Data



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


36.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:

Area
Description

Layout Status Bar



Figure 36-5: The Layout Status Bar


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

  • Layout status icon:

    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.

  • Layout name

    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.

  • Layout status message

Field Layout View



Figure 36-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



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


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

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

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

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

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

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


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

36.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 36-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:

Tips:


36.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:

36.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 36-12: 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.


36.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:


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


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

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

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

36.9 Frequently Asked Questions

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

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

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

36.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 © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
Previous Developing IMS Applications Defining Segment Layouts for IMS Databases Next"