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.
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.
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.
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.
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.
The COBOL layout starts to expand.
Here you name the segment file to match the database file, and save it in the loadlib project subfolder.
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.
This starts the IMS Database Editor, showing formatted data for the DEMOHDRS segment in the right pane. The key fields are highlighted in red.
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.
To create a default segment layout for DEMOELES, you edit the DEMO03DD.SLF segment layout file and add a second segment layout to it.
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.