PreviousEditing IMS Databases SQL Option for DB2Next"

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

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

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

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


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

37.5 The Segment Layout Editor Window

The Segment Layout Editor has one main window:



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


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

Area Name
Description

COBOL Header Bar



Figure 37-2: The COBOL Header Bar

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


Data Division View



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


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

Area Name
Description

Header Information Bar



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

  • Layout status icon:

    Icon
    Indicating
    The segment layout file contains segment layouts and there are no problems
    There are no layouts loaded. Consequently, the Segment Layout View is empty;
    A conditional segment layout does not have a test field

  • Name of the database for which these layouts were created

  • Number of layouts. If there are no layouts, displays "No Layouts".

  • Number of conditions attached to the segment layout that is highlighted in the Segment Layout View. If there are no conditions, displays "No Conditions".

  • EBCDIC/ANSI indicator. This is always set to EBCDIC.

You can toggle the Header Information Bar on and off.


Segment Layout View



Figure 37-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 field, click . To compress a segment layout or field, 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:

  • To view a tool tip describing the state of a segment layout:

    Click on the layout in the Segment Layout View and hold the cursor over the icon in the Header Information Bar

  • To view a tool tip listing all the conditions defined for a conditional layout:

    Hold the cursor over the icon next to the segment layout in the Segment Layout View

  • To view a tool tip displaying the condition set up for a test field within a segment layout:

    Hold the cursor over the icon next to the test field in the segment layout in the Segment Layout View


37.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 37-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.)

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

37.8 Frequently Asked Questions

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

37.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 © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousEditing IMS Databases SQL Option for DB2Next"