Tutorial: IMS Database Editor

Walks you through several features of the IMS Database Editor, including browsing the database, adding, modifying, and deleting a record, searching the database, adding and finding a segment bookmark, and setting up an SSA.

Prerequisites

This tutorial uses the three segment layouts created in Tutorial: IMS Segment Layout Editor. If you have not already run that tutorial, you must do so before proceeding.

Get Familiar with the IMS Database Editor

Start the IMS Database Editor
Here you start the IMS Database Editor, which shows formatted data for the first of two default segment layouts you created in the previous tutorial, with the key fields highlighted in red.
  • In the Solution Explorer, right-click the DEMO03DD DBD file; then select Edit Database from the context menu.
Note: If the right pane is obscured, reveal it by dragging the vertical bar located at the far right of the window leftwards across the window. Similarly, if the Tree view is obscured, drag the bottom of the DBD window downwards to reveal it.
Explore the IMS Database Editor Window
All of the components of the IMS Database Editor main window are shown and described in the topic IMS Database Editor window. Study that topic to become familiar with each component and the functionality it provides.
Browse 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 Tree view and select Start browse from the context menu.

    A Browse window opens in the left pane, showing a list of segment occurrences starting from your current position at the start of the database. In the right pane, the Field Layout View shows formatted data.

  3. In the left pane, where the Field Layout View shows formatted data for the Test Department, click JANE JONES.

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

    Note: When 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 Tree view, the Current Segment Arrow ( ) has moved to DEMOELES.

Add a Twin Segment Occurrence

At present, the database has only one record, which consists of the Test Department and two Test Technicians. Here you add a new DEMOHDRS segment occurrence for the Development Department. This new DEMOHDRS segment occurrence is a twin of the Test Department TESTDEPT segment occurrence:

  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 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; then click Yes and complete the change.

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

  5. Press Enter to add the edit to the segment buffer.
  6. Click inside the Value column for the 03 FILLER item, located below 02 DEMOHDRS-TABLE-DESCRIPTOR.
  7. Replace the current text with A TABLE OF SOFTWARE DEVELOPERS; then press Enter to add the edit to the segment buffer.
  8. Click  on the IMS Database Editor toolbar.

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

Add the First Child Segment Occurrence

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

  1. In the left pane of the window, click DEMOELES in the tree view.

    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 Edit > IMS DB Editor > Initialize Segment.

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

  3. In the right pane of the window, click inside the Value column that corresponds to 03 DEMOELES-KEY in the Field Name column.
  4. Type HELEN PARRY; then 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.

Modify 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. In the right pane of the window, click inside the Value column on the row that shows 03 FILLER PIC X (133).
  3. Replace the existing text with IMS DC TEST LEAD; then and press Enter.
  4. Click  on the IMS Database Editor toolbar.

    The segment occurrence for FRED SMITH is updated.

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

Search the Database

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

  1. From the Micro Focus Data File Tools menu, click Search > IMS DB Editor > Find.
  2. On the IMS Database Find bar, uncheck Match case, if it is not already unchecked.
  3. In the Find field, type in the word Table.
  4. From the End drop-down list, select at end of database.
  5. Click Find.

    The IMS Database Editor searches the database from your current position at the start of the database. In the Segment Data area in the left pane of the IMS Database Editor Window, you can see that 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.

  6. Click Find again.

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

  7. Click Find again.

    As there are no more occurrences of the word Table in the database, a prompt appears indicating that no more occurrences could be found.

  8. Click OK.
  9. 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.

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

Add and Find a Bookmark

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.

Add a bookmark
To add a bookmark in the database:
  1. Click  to position yourself at the DEMOELES segment occurrence for HELEN PARRY.
  2. Right-click inside the tree view and click Add Bookmark on the popup menu.
  3. In the text field on the Add bookmark dialog box, type First developer segment; then 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.

Find a Bookmark
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.
  1. Right-click inside the tree view and click Goto Bookmark on the popup menu.
  2. On the Bookmarks dialog box, click on the DEMOELES bookmark and then click Goto bookmark.

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

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

    On the SSA List, the SSA column for the DEMOHDRS segment shows None, indicating that DEMOHDRS has no SSAs.

  2. On the SSA list, double-click the DEMOHDRS segment.
  3. On the Define SSA dialog box, click Unqualified SSA for DEMOHDRS; then click OK.

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

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

  5. Click  on the IMS Database Editor toolbar.

    As there are no more DEMOHDRS segments, a message prompt appears, indicating that you have reached the end of database.

  6. Click Yes to reset to the start of the database.
  7. On the SSA list, double-click on DEMOHDRS.
  8. 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 shows None.

Close the Database and Data File Tools

To close the database and Micro Focus Data File Tools:

  • Click File > Exit.