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.
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.
This demo uses the project imsedemo.mvp that you created and built in the chapter Creating Segment Layouts for an IMS Database.
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.
In this session you:
To open a PCB in the IMS Database Editor:
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.
The IMS Database Editor window divides into a left-hand pane and a right-hand pane.
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 26-1: 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.
The left-hand pane of the IMS Database Editor window contains three areas. From top to bottom, these are:
This area is displaying a list of the segment types from DEMOHDRS up to the root. Since DEMOHDRS is at the top of the hierarchy, only DEMOHDRS is shown. The list is showing that there are no SSAs defined for DEMOHDRS.
This area is displaying character and hexadecimal representations of binary data for the first DEMOHDRS segment occurrence. Key fields are highlighted in red.
The right-hand pane of the IMS Database Editor window contains three areas. From top to bottom, these are:
This area gives information about the current segment layout:
The icon indicates that the segment layout is a default layout
The IMS Database Editor has loaded a segment layout named DEFAULT, indicating that this is the default segment layout for the segment type DEMOHDRS.
The status message reads as "Layout OK", indicating that a segment layout has loaded correctly.
This area uses a segment layout created during the session Creating Segment Layouts for an IMS Database to display the layout of the current segment occurrence in the demo database. Three columns list a field name, picture and value for each field. Key fields are displayed in red.
This area displays character and hexadecimal representations of binary data for the field that is highlighted in the Field Layout View. When a group item in the Field Layout View is highlighted, this area displays data for all the group items and fields inside that group item. Here, 01 DEMOHDRS is highlighted and therefore data for the entire segment is displayed.
The toolbar area displays a toolbar containing symbols for common DL/I commands, as well as other navigating and editing functions:
Figure 26-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:
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.
The text appears as "Goto current 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.
At the bottom of the Mainframe Express IDE window there is a status bar that displays the following information:
Figure 26-3: The IMS Database Editor Status Bar
To find out more about a status code returned by the IMS Database Editor:
The text appears as "Good, no status code returned".
To browse through segment occurrences from your current database position to the end of the database:
The Current Segment Arrow is pointing to DEMOHDRS.
A Browse window opens to show a page of segment occurrences, starting from your current position at the start of the database.
Figure 26-4: The Browse Window Open in the Left-Hand Pane
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.
The Browse window closes. In the Database Tree, the Current Segment Arrow has moved to DEMOELES.
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:
You are now positioned at the start of the database on the first segment occurrence TESTDEPT.
The field DEMOHDRS-KEY is now open for editing. Currently, the value shown is TESTDEPT.
As you begin to edit, an update warning appears.
The update warning is disabled for the rest of the editing session.
This inserts a new DEMOHDRS segment occurrence for the Development Department.
The next thing to do is add the first DEMOELES child for the Development Department:
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.
When you initialize a segment occurrence, alphanumeric fields are initialized to spaces and numeric fields are initialized to zeros.
This inserts the first child DEMOELES segment occurrence for the Development Department.
To edit the data in a segment occurrence:
This positions you at the DEMOELES segment occurrence for FRED SMITH.
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.
The segment occurrence for FRED SMITH now adopts the segment layout DEFAULT.
The segment occurrence for FRED SMITH is updated.
To delete a segment occurrence:
This positions you at the DEMOELES segment occurrence for JANE JONES.
A warning message appears.
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.
To open the IMS Database Find bar and locate a search string:
The IMS Database Find bar opens:
Figure 26-5: The IMS Database Find Bar
The IMS Database Editor searches the database from your current position at the start of the database.
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.
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.
As there are no more occurrences of the word Table in the database, the editor displays an error message.
Whether a search operation fails or succeeds, your current position in the database changes to the last segment searched.
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:
The Add bookmark dialog box opens:
Figure 26-6: The Add Bookmark dialog box
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.
The Bookmarks dialog box opens and displays the bookmark that you have just created:
Figure 26-7: The Bookmarks List
This repositions you back at the segment occurrence for HELEN PARRY.
The IMS Database Editor can store the SSAs that you create for up to the last ten databases edited.
To define an SSA:
This positions you at the top of the first DEMOHDRS segment occurrence which is the Table of Software Developers.
Figure 26-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.
The Define SSA dialog box appears.
Figure 26-9: The Define SSA Dialog Box
On the SSA list, the SSA column changes to "DEMOHDRS*-".
Because you just defined an unqualified SSA, Get Next With Hold returns another DEMOHDRS segment rather than the next DEMOELES segment.
As there are no more DEMOHDRS segments, Mainframe Express displays an end of database message.
This removes the unqualified SSA from DEMOHDRS. On the SSA list, the SSA column now contains the word "None".
To close the demo database:
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.
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.
Comments on the books? Click Send Us Comments.
Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.