PreviousConverting Data Files Rebuilding Corrupt Indexed FilesNext"

Chapter 13: Using Record Layouts with Data Files

This chapter describes the Record Layout Editor that Mainframe Express provides for creating record layouts so that you can view and edit data at field level.

For detailed information about using the Record Layout Editor, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, click Development Environment, Working with Data Files, Working with Record Layouts.)

13.1 Overview

A record layout is a representation of the structure of a data record. If you have a record layout available for a data file, you can browse and edit the data file at the individual field level within a record and see the numeric values of data held in non-display fields. COBOL programs contain record layouts. An example of a COBOL record layout is:

01 REC.
   02 EMP-CODE.
      03 EMP-POSITION        PIC X.
      03 EMP-NUM             PIC 9(6).
   02 EMP-AGE                PIC 99 COMP.
   02 EMP-YEARS-WITH-COMPANY PIC 99 COMP.

In this example, EMP-AGE and EMP-YEARS-WITH-COMPANY are numeric non-display fields.

You use the Record Layout Editor to create a record layout (.str) file that contains one or more record layouts for your data. A record layout file contains information describing the records in your data file, the name, length and picture of each field. If your data file includes multiple types of records, you can capture these multiple record layouts in one record layout file.

Once you have created the record layout file for a particular data file, you can keep the layout file and use it whenever you want to work with that data file. You only need to recreate the record layout file if either you change the record layout in your COBOL program or you want to add a new conditional record layout.

If your data file has a very simple record format, you might not need to create a record layout file for your data's formatted view.

Record layout files are used by the Data File Converter. For more details, see the chapter Converting Data Files.

13.2 Types of Record Layout

There are two types of record layout:

13.3 Creating a Record Layout

The Record Layout Editor uses the debug information (.idy) file from your compiled COBOL program to create a record layout file. Without an associated .idy file you cannot create a record layout file. You create an .idy by compiling your program for debug. If your COBOL record layout contains FILLER items, you must compile with the INCLUDE-FILLER compiler directive, in order for the record layout file to include the FILLERs. For more details on the INCLUDE-FILLER compiler directive, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, click Reference, Development Environment, Compiler Directives.)

To find out how to create a record layout and associate the record layout with a data file, see the help provided in the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, click Development Environment, Working with Data Files, Working with Record Layouts.)

For more help, refer to the chapter Maintaining and Creating Data Files in your Getting Started. This chapter contains a tutorial, part of which takes you through the process of creating a record layout file.

13.4 Loading and Associating Record Layouts

When you load or associate a record layout file with your data file, you can see your record data formatted at field level in the right-hand pane of Data File Editor's window. For more details, see the section Data File Editor Window in the chapter Editing Data Files.

If a record is found which doesn't match any of the available layouts or contains an invalid OCCURS DEPENDING ON RANGE, you see a warning message in the field view pane and status bar.

13.4.1 Mainframe-style Files

Because you are using a catalog for your data files, you can:

However, if you do either or both of these, you must also do one of the following:

To find out how to associate and load record layouts, see the Mainframe Express online help. (Click Help Topics on the Help menu. Then, on the Contents tab, click Development Environment, Working with Data Files, Working with Record Layouts.)

13.4.2 PC-style Files

If you are working with PC-style files, the record layout file loads automatically as long as the record layout is saved in the same folder and has the same basename as the data file. The record layout file has an .str extension.

13.5 Viewing Record Layout Conditions

If a data file has a record layout file loaded, you can look up information about the record layout file. Simply right-click in the Data File Editor window. Click File Information on the popup menu and click the Record Layouts tab.

The File Information window displays information about the record layout file. The top of the window displays the name and location of the record layout file.

If you click on one of the records under Layout Name, you can view the condition set up for that type of layout. This condition determines which records display that particular record layout in the formatted view.


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

PreviousConverting Data Files Rebuilding Corrupt Indexed FilesNext"