PreviousCreating Segment Layouts for an IMS Database DB2 Applications (SQL Option)Next"

Chapter 24: Editing an IMS Database

Use the IMS Database Editor to navigate and edit an IMS database.


You need to have read the chapter Start Here for the Tutorials and worked through the first session Using Mainframe Express and the session Creating Segment Layouts for an IMS Database before you do this session.

You need to have installed IMS Option to do this session. We assume you are familiar with IMS on a mainframe.


24.1 Overview

The IMS Database Editor provides a graphical interface for navigating and maintaining IMS databases. In this session, you learn how to use the IMS Database Editor to navigate and make changes to an IMS database by:

This session uses the same demo application as the chapter Creating Segment Layouts for an IMS Database.

24.2 Preparation

This demo uses the project imsedemo.mvp that you created and built in the chapter Creating Segment Layouts for an IMS Database.

  1. If you have closed Mainframe Express, open it as before. If any project window or other windows are open, close them.

  2. Open the project imsedemo.mvp in any of the ways described in the chapter Start Here for the Tutorials.

    The full path is \mfuser\projects\gsdemo\imsedemo\imsedemo.mvp. If you use Open on the File menu, you need the Files of Type field on the Open dialog box set to Project Files (*.mvp) to see this file.

24.3 Sample Session

In this session you:

24.3.1 Opening an IMS Database

To open a PCB in the IMS Database Editor:

  1. From the Project View, click the IMS tab.

  2. In the left-hand pane of the IMS View, click PSB Gens.

  3. In the right-hand pane, right-click DEMO001T. On the popup menu, click Show Entry Details.

  4. Right-click DEMO03DD and click Edit PCB #3 from PSB DEMO001T on the popup menu.

    The IMS Database Editor window opens. When you first open an IMS database in the IMS Database Editor, to prevent segments being locked unnecessarily, a segment is not loaded automatically for editing.

  5. To position yourself on DEMOHDRS at the start of the database, click IMS DB Editor > Get First Segment with Hold on the View menu.

  6. If not already maximized, maximize the IMS Database Editor window within Mainframe Express by clicking in the top right of the window.

    The IMS Database Editor window divides into a left-hand pane and a right-hand pane.

  7. If the right-hand pane is obscured, drag the vertical bar between the two panes leftwards across the window, until the window looks similar to the window shown in Figure 24-1.

    The right-hand pane contains the default segment layout that you have already defined for DEMOHDRS in the session described in the chapter Creating Segment Layouts for an IMS Database.



    Figure 24-1: The IMS Database Editor Window

24.3.2 Acquainting Yourself With the IMS Database Editor Window

Now take a look at the IMS Database Editor window. For a more complete description of the window, please refer to the section The IMS Database Editor Window in the chapter Editing IMS Databases in your User's Guide.

24.3.2.1 The Left-hand Pane

The left-hand pane of the IMS Database Editor window contains three areas. From top to bottom, these are:

24.3.2.2 The Right-hand Pane

The right-hand pane of the IMS Database Editor window contains three areas. From top to bottom, these are:

24.3.3 Finding Out More About Toolbar Buttons

The toolbar area displays a toolbar containing symbols for common DL/I commands, as well as other navigating and editing functions:



Figure 24-2: The IMS Database Editor Toolbar

The toolbar displays buttons for the most commonly used DL/I commands plus IMS Database Editor specific functions. To view the tool tip for a button:

  1. Hold the cursor over the button and wait for the tool tip to display.

    The text appears as "Get next segment with hold (Ctrl+N)" which indicates that, by either clicking on the button or pressing Ctrl+N, you can retrieve the next segment occurrence in the database.

  2. Hold the cursor over the button and wait for the tool tip to display.

    The text appears as "Goto segment", indicating that this button readjusts the Database Tree so that you can see the current segment. This button is useful for a larger database with many segment types; use this button when you have scrolled up or down the Database Tree and lost sight of your current position.

24.3.4 Checking the Status Code

At the bottom of the IMS Database Editor window there is a status bar that displays the following information:



Figure 24-3: The IMS Database Editor Status Bar

To find out more about a status code returned by the IMS Database Editor:

  1. Hold the cursor over the status code which is currently displaying "Status: BLANKS" and wait for the tool tip to display.

    The text appears as "Good, no status code returned".

24.3.5 Browsing Through Segment Occurrences

To browse through segment occurrences from your current database position to the end of the database:

  1. To make sure you are positioned at the start of the database, click on the IMS Database Editor toolbar.

    The Current Segment Arrow is pointing to DEMOHDRS.

  2. Right-click in the left-hand pane of the window and select Start browse from the popup menu.

    A Browse window opens to show a page of segment occurrences, starting from your current position at the start of the database.



    Figure 24-4: The Browse Window Open in the Left-Hand Pane

  3. Look at the right-hand pane of the window, where the Field Layout View is showing formatted data for the Test Department. In the left-hand pane, click JANE JONES in the Browse window.

    The right-hand pane updates to show formatted data for Jane Jones.

    If you double-click a segment occurrence in the Browse window, you change your current position in the database to that segment occurrence.

  4. Double-click JANE JONES.

    The Browse window closes. In the Database Tree, the Current Segment Arrow has moved to DEMOELES.

24.3.6 Adding a Twin Segment Occurrence

At present, the database has only one record which is the Test Department and two Test Technicians.

Now add a new DEMOHDRS segment occurrence for the Development Department. This new DEMOHDRS segment occurrence will be a twin for the Test Department TESTDEPT:

  1. Click on the IMS Database Editor toolbar to move to the start of the database.

    You are now positioned at the start of the database on the first segment occurrence TESTDEPT.

  2. In the right-hand pane of the window, look for DEMOHDRS-KEY in the Field Name column. Click inside this row in the Value column.

    The field DEMOHDRS-KEY is now open for editing. Currently, the value shown is TESTDEPT.

  3. Change TESTDEPT to DEVDEPT.

    As you begin to edit, an update warning appears.

  4. Check Switch update warning off. Click Yes in reply to the update warning and carry on typing.

    The update warning is disabled for the rest of the editing session.

  5. When you have changed the text to DEVDEPT, press Enter to add the edit to the segment buffer.

  6. Click inside the Value column for the 03 FILLER item below 02 DEMOHDRS-TABLE-DESCRIPTOR and change A TABLE OF SOFTWARE TESTERS to A TABLE OF SOFTWARE DEVELOPERS. Press Enter to add the edit to the segment buffer.

  7. Click on the IMS Database Editor toolbar.

    This inserts a new DEMOHDRS segment occurrence for the Development Department.

24.3.7 Adding the First Child Segment Occurrence

The next thing to do is add the first DEMOELES child for the Development Department:

  1. In the left-hand pane of the window, click DEMOELES in the Database Tree.

    The data empties from the Field Layout View and the Segment Data and Field Data areas. The Field Layout View adopts the default segment layout you created for DEMOELES.

  2. Click IMS DB Editor > Initialize Segment on the Edit menu.

    When you initialize a segment occurrence, alphanumeric fields are initialized to spaces and numeric fields are initialized to zeros.

  3. In the right-hand pane of the window, look for 03 DEMOELES-KEY in the Field name column. Click inside this row in the Value column.

  4. Type in HELEN PARRY and press Enter to add the edit to the segment buffer.

  5. Click on the IMS Database Editor toolbar.

    This inserts the first child DEMOELES segment occurrence for the Development Department.

24.3.8 Modifying a Segment Occurrence

To edit the data in a segment occurrence:

  1. On the IMS Database Editor toolbar, click two times.

    This positions you at the DEMOELES segment occurrence for FRED SMITH.

  2. Change the text "IMS DC TEST TECHNICIAN" to IMS DC TEST LEAD and press Enter.

    The IMS Database Editor warns you that you are just about to change a test field for a conditional segment layout.

    This field, which is the FILLER item under 02 DEMOELES-ELE-DATA, is a test field for a conditional segment layout. You set this field up as a test field when you created the conditional segment layout DEMOELES-DEMOELES in the session Creating Segment Layouts for an IMS Database. The Layout Status Bar displays the layout name for this conditional segment layout as DEMOELES.

    If you change the data in a test field so that the field no longer meets the conditions set up for the current segment layout, the IMS Database Editor selects another layout automatically.

  3. Click Yes.

    The segment occurrence for FRED SMITH now adopts the segment layout DEFAULT.

  4. Click on the IMS Database Editor toolbar.

    The segment occurrence for FRED SMITH is updated.

24.3.9 Deleting a Segment Occurrence

To delete a segment occurrence:

  1. To select the next segment occurrence, click on the IMS Database Editor toolbar.

    This positions you at the DEMOELES segment occurrence for JANE JONES.

  2. Click on the IMS Database Editor toolbar.

    A warning message appears.

  3. Click Yes to delete the segment occurrence for JANE JONES.

    As this is the last segment in the database, a message asking if you want to reset your position to the start of the database is displayed.

  4. Click Yes to return to the start of the database.

24.3.10 Searching for a Text String

To open the IMS Database Find bar and locate a search string:

  1. Click IMS DB Editor > Find on the Search menu.

    The IMS Database Find bar opens:



    Figure 24-5: The IMS Database Find Bar

  2. Uncheck Match case, if it is not already unchecked.

  3. In the Find field, type in the word Table.

  4. In the End field, click at end of database.

  5. Click Find.

    The IMS Database Editor searches the database from your current position at the start of the database.

  6. Look in the Segment Data area in the left-hand pane of the IMS Database Editor Window.

    The cursor is positioned at the start of the first occurrence of the string "Table". If you look at the Field Layout View, you can see that this is in the segment occurrence for A TABLE OF SOFTWARE DEVELOPERS.

  7. Click Find again.

    The Segment Data area displays the second occurrence of "Table". If you look at the Field Layout View, you can see that this is in the segment occurrence for A TABLE OF SOFTWARE TESTERS.

  8. Click Find again.

    As there are no more occurrences of the word Table in the database, the editor displays an error message.

  9. Click OK.

  10. To close the IMS Database Find bar, click the Close button in the top right of the window.

    Whether a search operation fails or succeeds, your current position in the database changes to the last segment searched.

  11. Click on the IMS Database Editor toolbar to move to the start of the database.

24.3.11 Using Bookmarks

With the IMS Database Editor, you can navigate your way forwards but not backwards through the database. To help you, the IMS Database Editor provides a bookmarking utility so that you can mark any segment occurrences that you want to go back to. This saves you from having to issue a number of DL/I calls to position yourself at that segment occurrence again.

To add a bookmark:

  1. Click to position yourself at the DEMOELES segment occurrence for HELEN PARRY.

  2. Right-click inside the Database Tree and click Add Bookmark on the popup menu.

    The Add bookmark dialog box opens:



    Figure 24-6: The Add Bookmark dialog box

  3. In the text box, type in First developer segment and click OK.

  4. On the IMS Database Editor toolbar, click to select the next segment.

    As there is only one developer in the Table of Developers, this takes you to the next DEMOHDRS segment occurrence which is the Table of Software Testers.

    Now suppose that you want to jump back to the segment occurrence for HELEN PARRY. If this was a large database, it could take some time to go to the end of the database and work your way through from the start.

    However, because you inserted a bookmark at the first developer occurrence, you can use the bookmark to move directly there.

  5. Right-click inside the Database Tree and click Goto Bookmark on the popup menu.

    The Bookmarks dialog box opens and displays the bookmark that you have just created:



    Figure 24-7: The Bookmarks List

  6. In the bookmark list, click on the DEMOELES bookmark and then click Goto bookmark.

    This repositions you back at the segment occurrence for HELEN PARRY.

24.3.12 Setting up an SSA

The IMS Database Editor can store the SSAs that you create for up to the last ten databases edited. To define an SSA:

  1. Click on the IMS Database Editor toolbar to move to the start of the database.

    This positions you at the top of the first DEMOHDRS segment occurrence which is the Table of Software Developers.

  2. Look at the SSA List:



    Figure 24-8: The SSA List in the IMS Database Editor Window

    The SSA column lists "None" against DEMOHDRS, indicating that at present DEMOHDRS has no SSAs set up.

  3. On the SSA list, double-click on DEMOHDRS.

    The Define SSA dialog appears.



    Figure 24-9: The Define SSA Dialog Box

  4. Click the Unqualified SSA for DEMOHDRS radio button and click OK.

    On the SSA list, the SSA column changes to "DEMOHDRS*-".

  5. Click on the IMS Database Editor toolbar.

    Because you just defined an unqualified SSA, Get Next With Hold returns another DEMOHDRS segment rather than the next DEMOELES segment.

  6. Click on the IMS Database Editor toolbar.

    As there are no more DEMOHDRS segments, Mainframe Express displays an end of database message.

  7. Click Yes to reset to the start of the database.

  8. On the SSA list, double-click on DEMOHDRS.

  9. On the Define SSA dialog box, click No SSA and click OK.

    This removes the unqualified SSA from DEMOHDRS. On the SSA list, the SSA column now contains the word "None".

24.3.13 Closing the Database

To close the demo database:

  1. Click Close on the File menu.

    If the demo database was a remote database or you were using Fileshare, you would have to click to commit your changes before closing the database. As the demo database is local to your PC, your changes are saved automatically.

The database closes and the changes you have made are saved.

24.4 Before Continuing

Close the project. If you want to take a break before going on to the next session, you can close Mainframe Express.

Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousCreating Segment Layouts for an IMS Database DB2 Applications (SQL Option)Next"