Create a Structure File

  1. From the Micro Focus Data File Tools window, click File > New > Structure File.

    The Open dialog box appears.

  2. Navigate to an .idy file for a compiled program that uses the data file that you plan to apply this structure file to, then click Open.
    Note: Programs must be compiled for debug in order to produce an .idy file.

    A new Structure tab is displayed, which contains the Data Division of the .idy file in the Available Layouts pane. The group structures are maintained, but the levels use consecutive numbering instead of the numbering used in the COBOL source.

    The Structure File editor

  3. To create a default layout, from the Available Layouts pane, right-click the required level entry and select Create Default Layout.

    The new default layout appears in the Selected Layouts pane, and consists of the selected level entry and any sub-level entries.

    The Available Layouts pane

    This is the layout that a record will use if there are no other layouts, or no other layouts that have criteria that matches with the record.

  4. (Optional) Create a conditional layout:

    The ANSI/EBCDIC indicator (displayed to the right of the Browse button) defaults to the character set specified when the COBOL compilation generated the debug file (.idy file). It indicates the character set representation to be shown when adding condition values to the next conditional layout.

    1. If the indicator is showing a character set other than the one required, click the indicator and select the required character set.
    2. Right-click another level entry in the Available Layouts pane, then select Create Conditional Layout.

      The new conditional layout appears in the Selected Layouts pane.

      Note: You can differentiate the layouts by the icons The Default Layout icon (Default) and The Conditional Layout icon (Conditional).
    3. In the Selected Layouts pane, expand the layout to display the field on which to base the condition, then right-click it and select Properties.
      Note: Conditions cannot be applied to group fields within a layout.

      The Field Properties dialog box appears.

    4. Check Convert if you plan to use this layout with the Data File Converter and want this field to be converted between EBCDIC and ANSI. Clear this option if the field contain non-text data items (for example, binary values), which you do not want to be converted (as they will corrupt the converted file).

      The presence of in the Selected layouts pane indicates which fields within the record would be converted:

      The Converted Fields indicator
    5. From the Condition section, select Set Condition to enable the condition properties.
    6. Click the current operator and select an appropriate operator from the list.
    7. Complete the value(s) for the condition.
    8. Click OK.
      Note: You can add more conditions to other entries; any record must match all conditions for all entries in order to use the layout.
  5. On the File menu, select Save As....

    The Save As dialog box appears.

  6. In the Filename field, type the name of the structure file and click Save.
    Tip: If you save the file with the same basename and in the same location as the data file that it will be applied to, this structure file is automatically applied when you open the data file. Similarly, if you already use a structure file of the same basename and in the same location (for example, to store the file header details), select it again to append the layout information for the file.