Create Default Segment Layouts for DEMOHDRS and DEMOELES

Guides you through the tasks associated with creating two default segment layouts.

You can define one default segment layout for each segment type. The IMS Database Editor uses the default segment layout to format data for those segment occurrences that do not match any of the conditional segment layouts.

Create a default segment layout

  1. In the Solution Explorer, right-click DEMO01T.CBL, and then select Create Segment Layout File from the context menu.

    The Segment Layout Editor extracts the COBOL layout information from the selected COBOL file's corresponding debug information (.idy) file.

    The New IMS Layout dialog box opens and displays a list of IMS databases. Here, you select the IMS database for which you want to create segment layouts.

  2. As the demo database DEMO03DD is the only database listed, click Create.

    The Segment Layout Editor opens. The left pane of the Segment Layout Editor window displays the Data Division of demo01T.idy. The right pane is empty because, as yet, you have no segment layouts defined.

    In the next step, you select the DEMOHDRS COBOL layout and apply it to the DEMOHDRS segment type in the DEMO03DD database. Here, the layout and the segment type share the same name (DEMOHDRS), but the two names can be different.

  3. Drag 01 DEMOHDRS from the left pane of the window across to the right pane.
    Note: 01 DEMOHDRS is located near the bottom of the WORKING-STORAGE SECTION list, so you might need to resize the Segment Layout Editor window, or scroll down the list to see it.

    This action invokes the New Segment Layout wizard where you can create a default segment layout for DEMOHDRS based on the 01 DEMOHDRS COBOL layout that you have just dropped into the right pane.

  4. Select the DEMOHDRS segment name; then click Next.
  5. As Default Layout is already selected, click Next.
  6. Click Finish.

    The wizard adds the layout you have just defined for DEMOHDRS to the right pane of the window. As this is the default layout for the segment type DEMOHDRS, the word "DEFAULT" is appended to the segment-name DEMOHDRS.

  7. Click Expand icon next to DEMOHDRS-DEFAULT.
  8. Click Expand icon next to 01 DEMOHDRS.

    The COBOL layout starts to expand.

  9. Click Expand icon against each group item until you can see the entire COBOL layout.

Save the segment layout

Here you name the segment file to match the database file, and save it in the loadlib project subfolder.

  1. Click Save Save icon.
  2. Browse to the loadlib subfolder of your IMSSupport project.
  3. In the File name field, type DEMO03DD.
  4. Click Save.
  5. Close Micro Focus Data File Tools.

View the segment layout

In this section, you view the new DEMOHDRS-DEFAULT segment layout in the IMS DB Editor. Because you have defined this segment layout, when you open the IMS Database Editor, the DEMOHDRS-DEFAULT layout loads automatically and the data for the DEMOHDRS segment is formatted. This means that from this point on, you can view and edit formatted data in DEMOHDRS segment occurrences.

Start the IMS Database Editor
  • In the Solution Explorer, right-click the DEMO03DD DBD file; then select Open With > IMS Database Editor from the context menu.

    This starts the IMS Database Editor, showing formatted data for the DEMOHDRS segment in the right pane. The key fields are highlighted in red.

Advance to the next segment
  • On the tool bar, click GHN button twice to move to the next segment occurrence, which belongs to segment type DEMOELES.

    Because you have not yet defined a segment layout for DEMOELES, the Field Layout View in the right pane empties. The next thing to do, therefore, is to return to the Segment Layout Editor and define a default layout for the DEMOELES segment.

Close Micro Focus Data File Tools
  • From the Micro Focus Data File Tools menu, click File > Exit to close the window.

Create another default segment layout

To create a default segment layout for DEMOELES, you edit the DEMO03DD.SLF segment layout file and add a second segment layout to it.

Open the segment layout file
  1. In the Solution Explorer, right-click DEMO001T.CBL; then select Create Segment Layout File from the context menu.
  2. As the demo database DEMO03DD is the only database listed, click Create.
  3. Click File > Open.
  4. If not already in the loadlib project subfolder, browse to it.
  5. From the Files of type drop-down list, select All Files (*.*).
  6. Double-click DEMO03DD.SLF.
  7. Click Yes at the prompt.
Load program information
  1. Right-click DEMOHDRS-DEFAULT, and then select Load program information from the context menu.
  2. Double-click DEMO00IT.idy.
Create a default segment layout for DEMOELES
  1. Drag 01 DEMOELES from the left pane of the window across to the right pane.
  2. Select the DEMOELES segment name; then click Next.
  3. As Default Layout is already selected, click Next.
  4. Click Finish.

    The wizard adds the layout you have just defined for DEMOELES to the right pane of the window. As this is the default layout for the segment type DEMOELES, the word DEFAULT is appended to the segment-name DEMOELES.

  5. Click Save Save button to save the new segment in DEMO03DD.SLF.