Chapter 38: Defining Segment Layouts for IMS Databases

This chapter describes the Segment Layout Editor that you can use to provide formatting for the data in IMS segment occurrences. You can then use the IMS Database Editor to view and edit the IMS segment occurrences. For more information on using the IMS Database Editor to edit IMS databases, see the chapter Editing IMS Databases.

For detailed instructions on using the Segment Layout 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, Working with Segment Layouts.)

38.1 Overview

When you first load an IMS database into the IMS Database Editor, the data in the right-hand pane is not formatted for you to view or edit.

To enable you to view and edit formatted IMS data, you use the Segment Layout Editor. Each time you create a segment layout, the Segment Layout Editor:

  1. Extracts the data layout from the Data Division of a debug information (.idy) file

    You produce this file by compiling a COBOL source (.cbl) file for debug within the project.

  2. Attaches the data layout to a nominated segment type in an IMS database

    When you open that database in the IMS Database Editor, the editor can apply formatting to segment occurrence data within that segment type.

The layout that you create is referred to as a segment layout. The layout describes the name, length and picture of each field in the segment. You can create more than one segment layout for a segment type by setting up conditions on test fields. The IMS Database Editor uses the test fields to work out which layout to use for which segment occurrence.

When you create segment layouts for an IMS database for the first time, you save the segment layouts in a segment layout (.slf) file. You can add more layouts later on by editing the .slf file. You can also open the .slf file and delete segment layouts that you no longer require.

38.2 Types of Segment Layout

There are two types of segment layout:

When you initialize a segment occurrence, you can choose to specify the segment layout that you want to use to enter data.

When you modify data, the IMS Database Editor works out automatically which layouts to use for which occurrences.

38.3 Creating Segment Layouts

To create segment layouts for an IMS database for the first time, the Segment Layout Editor requires two pieces of information:

Then, for each segment layout that you want to create, you have to:

  1. Select a layout from the Data Division

  2. Specify the segment type that is going to use the layout

In addition, for conditional segment layouts only, you need to select the test field(s) and specify the test condition(s). For more information, see the section Setting up a Test Condition.


Warning: Make sure that the setting Create debug information is checked. If it is not checked, then the Build does not produce a debug information (.idy) file. To access this setting, click Build Settings for Project on the Project menu and click the COBOL tab.


38.4 Layout-names

Within the Segment Layout Editor, the layout-name is made up of two parts, separated by a hyphen (-). Depending upon whether the segment layout is a default or conditional segment layout, the layout-name is constructed as follows:

38.5 The Segment Layout Editor Window

The Segment Layout Editor has one main window:



Figure 38-1: The Segment Layout Editor Window

The Segment Layout Editor divides into parts:


Tip: If you have just opened a segment layout (.slf) file, you can load a Data Division in the left-hand pane by right-clicking in the Segment Layout Editor window and clicking Load Data Division on the popup menu.


38.5.1 Left-hand Pane

The left-hand pane displays the Data Division that you load from the debug information (.idy) file associated with your chosen COBOL source (.cbl) file.

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

38.5.1.1 COBOL Header Bar



Figure 38-2: The COBOL Header Bar

The COBOL Header Bar displays the name of the COBOL program from which the Data Division is taken.

38.5.1.2 Data Division View



Figure 38-3: The Data Division View

The Data Division View Displays the Data Division of the selected COBOL program.


Note: To open a Data Division in the left-hand pane, make sure that the DBD displayed in the Header Information Bar is in an IMS project that is currently open and is present in the IMS View.


38.5.2 Right-hand Pane

The areas on the right-hand pane of the Segment Layout Editor window are described below, from the top down:

38.5.2.1 Header Information Bar



Figure 38-4: The Header Information Bar

The Header Information Bar gives information about the status of the segment layout file and is made up of the:

You can toggle the Header Information Bar on and off.

38.5.2.2 Segment Layout View



Figure 38-5: The Segment Layout View

The Segment Layout View lists segment layouts currently defined for the IMS database that is displayed in the Header Information Bar.

Layout Icon
Indicating
A default segment layout
A conditional segment layout
A field that is part of the layout
A test field in a conditional segment layout

To expand a segment layout or group item, click . To compress a segment layout or group item, click .

To highlight a layout or field, click on the layout or field. The Header Information Bar updates to display the number of conditions, if any, set up for the highlighted layout.


Tips:


38.6 Setting up a Test Condition

For each conditional segment layout, you must specify one or more conditions that a segment occurrence must fulfil to adopt that layout. Each condition is related to a test field. You use the Field Properties dialog box to specify a condition:



Figure 38-6: Conditions Offered by the Field Properties Dialog Box

From the Segment Layout Editor window, you can open the Field Properties dialog box by right-clicking on a field and selecting Properties.

When you select a condition, either one or both of the value boxes to the right becomes available. For example, the condition IS = TO only requires you to enter one value, whereas the condition IS BETWEEN requires you to enter two values.

The Segment Layout Editor window displays against each test field.

For full instructions on how to create a conditional segment layout, 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, Working with Segment Layouts, Creating and Removing Segment Layouts.)

38.7 Saving a Segment Layout File

Before exiting from the Segment Layout Editor, you should save the segment layout information in a segment layout (.slf) file.

The default settings for the segment layout file are:

Segment Layout File
Default Setting
File basename The same name as the IMS database name
File extension .slf
Folder The DATA folder of the project folder for the IMS database

As long as you retain these default settings, the IMS Database Editor loads the segment layout file automatically when you open the database. Otherwise, you can load the segment layout file separately.

The next time that you want to create segment layouts for the database or make changes to the segment layouts you already have, simply open the segment layout (.slf) file that you have saved for the database. The Segment Layout Editor window opens and displays the segment layouts you have already created.

38.8 Frequently Asked Questions

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

38.8.1 Cannot Load a Data Division

Q?: Why does the Segment Layout Editor display the message "The IMS interface will not allow processing of the DBD resources at this time" when I attempt to load a Data Division?

A. There are two circumstances under which the Segment Layout Editor displays this particular message:


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