PreviousCOBOL Source Information Data File Editor TutorialNext

Chapter 4: Data File Editor

The Data File Editor is a data tool that enables you to tailor input data files, for use in program testing, and view output data files, to verify the program is operating correctly. You can edit and view data as records formatted against your program specification, with minimal set-up work.


Warning: Striped files are not supported by Data File Editor.


4.1 Introduction

The Data File Editor lets you view and edit all Micro Focus supported types of data files. This enables you to tailor data files to provide more finely tuned test data for your applications, and also to easily view any data files output by your applications as a way of verifying their operation.

4.1.1 Display

Records can be displayed in unformatted or formatted mode.

In unformatted mode, records are displayed as simple character strings.

In formatted mode, records are formatted against a record stucture extracted from your programs. You select record structures from a list of data items defined in a program that has been syntax-checked by the Compiler. Conditions can be associated with those structures so that the correct structure is automatically applied to each record.

4.1.2 Editing

You edit data by over-typing existing data and replacing the current record.

Records can also be inserted or deleted for any file type. Your file is updated when it is saved. This requires the whole file to be loaded and might not, therefore, be suitable for large files.

Data can be edited in character mode or in hexadecimal mode.

4.1.3 Keys

An indexed file is sequenced by its active (or read) key field, which you can select. You can also search for particular values on any key. In unformatted mode, key data is highlighted.

4.1.4 Searching

You can search for text strings in your file. The search string can be entered in character or hexadecimal format.

4.2 Invoking the Data File Editor

You can invoke the Data File Editor either from the Server Express Integrated Development Environment (SDE) or from the command line. When you invoke the Data File Editor, it uses the settings in the local configuration file to determine character set, edit mode and whether or not to perform backups. See the section Configuration File later in this chapter for details of this file.

If you want to use the Data File Editor to display only unformatted data, no preparatory steps are required.

If you want to display data formatted according to record structures in your program(s), you must first create the .str file, which is produced by the Structure Selector (see the section Structure Selector later in this chapter). This file holds one or more record structures which can then be directly or automatically applied to records to produce a display of the data in formatted mode.

The functions of the Data File Editor are accessed through menus. From some menus you can display other menus, called the Alternate and Control menus, which are accessed using the Alt and Ctrl keys. These keys are toggle keys. See the appendix UNIX Key Usage Chart for further information on these keys.


Note: To use the Data File Editor, LINES should be set to 25.


4.2.1 Invoking from the SDE

To invoke the Data File Editor from the SDE, select F4=data-file-editor from the Alternate menu. The initial Data Editing menu is displayed, as shown in Figure 4-1.



Figure 4-1: Data Editing Menu

You can load your data file using F3=load-file or create a new file using F5=new-file; both options are on the Alternate menu.

You can also enter the Structure Selector without loading a data file, using F8=structure-selector on the Alternate menu.

4.2.2 Invoking from the Command Line

The command line to invoke the Data File Editor is shown below. You can specify entry parameters so that you invoke the Data File Editor and load your file straight away, or you can specify the parameters after invoking the Data File Editor.

dfed [filename] [{-A|-E}] [{-b|-B}]

where the parameters are:

filename Name of the file you want to edit. If you do not specify filename, you have to specify the file after the Data File Editor is invoked.
-A Specifies that the file uses the ASCII character set.
-E Specifies that the file uses the EBCDIC character set.

If you do not specify either -A or -E, the value specified in the configuration file is used. If there is no configuration file, ASCII is assumed. You can also toggle between ASCII and EBCDIC from the Data File Editor menus.

-b Sets the backup option on.

Your source file will copied to filename.dbk before any editing is performed. If the file is indexed, the index will be copied to filename.ibk.

Make sure you have sufficient disk space before setting this option on. If there is insufficient disk space for backup you are positioned in the Load File menu.

-B Sets the backup option off.

If you do not specify either -b or -B, the value specified in the configuration file is used. If there is no configuration file, the backup option is assumed to be on.

The parameters can be specified in any order.

4.2.3 Configuration File

When you invoke the Data File Editor, it searches for the local configuration file. See the chapter Configuring Development Tools in your Getting Started.

This configuration file contains the following parameters:

[DFED] Defines the name of the configuration details
BACKUP: Set to either ON or OFF
CHAR-SET: Set to either ASCII or EBCDIC
EDIT-MODE: Set to either FULL or QUICK
UPDATE-WARNING: Set to either ON or OFF

You can change the settings in the configuration file using a text editor such as the COBOL Editor.

4.3 Character Sets

The Data File Editor displays a file using either the EBCDIC or ASCII character set. EBCDIC is the character set commonly used on IBM mainframes and supported by Server Express. ASCII is the character set normally used on personal computers.

After you have loaded a file, you can switch between the two character sets using the toggle-character-set option on either the Load File menu or the Data File Editor Control menu.

4.4 Data Editing Screen

The Data Editing screen is the first screen loaded by the Data File Editor. It is displayed with the Data File Editor main menu.

The main menu is displayed at the bottom of the screen. You can replace this with the Alternate or the Control menu by pressing and holding the Alt or Ctrl key respectively. The Alternate menu contains functions which operate on the display of the file records and also enables you to load a data file. The Control menu contains functions for handling keys and performing searches. Your current position in indexed files is shown by highlighted index keys.

You load a file by pressing F3 (for an existing file) or F5 (for a new file) on the Alternate menu. Then more menu functions become available.

When you load a file, the Data Editing screen displays record details and the file contents. The Structure Selector screen enables you to specify the record format (see the section Structure Selector later in this chapter).

The record details are displayed on the status line. These include:

Col For unformatted mode, shows the byte in the record currently being edited.
For formatted mode, shows the byte in the field currently being edited.
Rec-start For unedited records, shows the position in the original file at which the record begins.
For edited records, shows the position in the file after you have saved it.
Len Shows the length of the record currently being edited.

Note: The COBOL clause OCCURS DEPENDING ON is not supported. The data item defined by this clause is set to the maximum size.


You can obtain information about the file at any time by pressing F10=file-info on the Alternate menu. This displays the Configuration Screen. Details of the current file are displayed. If the file is indexed, you can examine or change any key by selecting it in the key list and pressing space.

The data can be displayed in either formatted or unformatted mode. The display is initially unformatted; F2=toggle-format switches between the two modes of display.

4.4.1 Unformatted Mode

In unformatted mode, the data is displayed as a string of data. Several records can be displayed, one record per line. Wide records extend off the screen. By default, the first 69 (or fewer, if the record contains fewer than 69 characters) characters of the first 21 (or fewer, if the file contains fewer than 21 records) records are displayed. If you have a larger screen and are using the +C RTS switch, more records can be displayed. This mode uses a highlight to indicate the current record.

For relative files, the relative record numbers are displayed on the left-hand side of the screen. For other types of file, the numbers displayed on the left hand side of the screen are the byte offset at which the record starts in the file. If a file header exists, the offset includes 128 bytes of header information so the record might not start at byte 0.

When editing a file in unformatted mode, the field(s) which form the currently selected key and all alternate keys are highlighted.

Figure 4-2 shows the unformatted mode of display.



Figure 4-2: Data Editing Screen - Unformatted Data

4.4.2 Formatted Mode

Formatted mode is available only after you load a .str file. The .str file is produced by the Structure Selector and holds one or more record structures which can be applied directly or automatically to the record so that data is displayed in its correct format. One record is displayed at a time. The first 21 (or fewer, if the record contains fewer than 21 fields) fields of the current record are displayed. Wide fields extend off the screen.

This mode uses a highlight to indicate the current field.

Any REDEFINES clauses are updated only when the cursor is moved off the field containing the REDEFINES clause. Similarly, group items are updated only when the cursor is moved off the group item.

For invalid numeric data, zeros are displayed in the numeric field.

Figure 4-3 shows the formatted mode of display.



Figure 4-3: Data Editing Screen - Formatted Data

4.4.3 Hexadecimal Editing

The Data File Editor can display the hexadecimal values of record contents, and enables you to change the values displayed. In this way, you can edit non-display characters, or enter invalid characters into numeric fields (for testing purposes).

When you have invoked the hexadecimal display, using F2=toggle-hex from the Alternate menu, the screen display changes so that the hexadecimal values are shown underneath the character display. The top line of the hexadecimal display contains the most significant half of a byte, and the bottom line contains the least significant half.

Figure 4-4 shows a screen in unformatted mode with a hexadecimal display.



Figure 4-4: Data Editing Screen - Hexadecimal Unformatted Data

Figure 4-5 shows a screen in formatted mode with a hexadecimal display.



Figure 4-5: Data Editing Screen - Hexadecimal Formatted Data

4.4.4 Keys Used for File and Data Navigation

4.4.4.1 Unformatted Mode

The following keys let you move around your file when the data is displayed in unformatted mode:

Key
Function
<left-arrow> Moves the cursor left one character position.
<right-arrow> Moves the cursor right one character position.
<up-arrow> Moves to the previous record. If you are using hexadecimal display, this key also enables movement to the previous byte of the record.
<down-arrow> Moves to the next record. If you are using hexadecimal display, this key also enables movement to the next byte of the record.
Tab Moves the cursor eight bytes forward in the file.
Shift+Tab Moves the cursor eight bytes backward in the file.
Home The first time you press Home, the cursor moves to the top of the screen. If the cursor is already at the top of the screen, it moves the cursor to the start of the record. If the cursor is already at the start of the record, it moves to the top of the screen.
End Moves the cursor to the end of the screen. If the cursor is already at the end of the screen, it moves to the end of the record. If the cursor is already at the end of the record, it moves to the end of the screen.
Page Up Moves the current record backward by the number of records displayed on your screen.
Page Down Moves the current record forward by the number of records displayed on your screen.
Ctrl+Home Moves to the start of the data file.
Ctrl+End Moves to the end of the data file.
Ctrl+<left-arrow> Moves the current record across the screen to the left. The number of bytes moved depends on the number of bytes displayed on your screen.
Ctrl+<right-arrow> Moves the current record across the screen to the right. The number of bytes moved depends on the number of bytes displayed on your screen.
Backspace Moves the cursor back one space and places a space at the new position.

4.4.4.2 Formatted Mode

The following keys let you move around your file when the data is displayed in formatted mode:

Key
Function
<left-arrow> Moves the cursor left one character position.
<right-arrow> Moves the cursor right one character position.
<up-arrow> Moves to the previous record. If you are using hexadecimal display, this key also enables movement to the previous byte of the record.
<down-arrow> Moves to the next record. If you are using hexadecimal display, this key also enables movement to the next byte of the record.
Tab Moves the cursor eight bytes forward.
Shift+Tab Moves the cursor eight bytes backward.
Home The first time you press Home, the cursor moves to the start of the field. The second time moves the cursor to the start of the screen. If the cursor is already at the start of the field, it moves to the top of the screen.
End The first time you press End, the cursor moves to the end of the field. The second time moves the cursor to the end of the screen. If the cursor is already at the end of the field, it moves to the base of the screen.
Page Up Moves the current field backward by the number of fields displayed on your screen.
Page Down Moves the current field forward by the number of fields displayed on your screen.
Ctrl+Home Moves to the start of the record.
Ctrl+End Moves to the end of the record.
Backspace Moves the cursor back one space and places a space at the new position.
Ctrl+<right-arrow> Moves the page to the left.
Ctrl+<left-arrow> Moves the page to the right.

4.5 Editing Records

To edit a record, use the cursor keys to highlight the item you want to change and type in the new value. You can also insert or delete records for any file type.

4.6 Adding Records

You can add records either before the current record by pressing F3=insert-record, or after the current record by pressing Enter. Note that pressing Enter works only when the Insert function on your keyboard is on. For relative files, a record number is requested when inserting the record. If a structure file is already loaded when you try to insert a record, a list of all the available structures is displayed. You can either select one of these structures and insert it, or you can insert an empty record.

4.7 Working with Indexed Files

When you load a file, the Data File Editor determines your file organization from the file header, so you do not need to tell it whether you have an indexed file or not.

If your data file has one or more keys, the file records are automatically sequenced according to the currently selected key. This is known as the read key. The read key defaults to the prime key; you can change it subsequently using F2=change-read-key on the Configuration Screen menu. If the current key enables duplicate values and these exist in your file, the records are ordered into blocks of identical key values. The ordering in those blocks is determined by the order in which the records were written into the file.

You can search for particular values of the current key and you can change key values.

If you change the value of a key in your file, the sequence of the file is updated, if necessary, before the next operation is executed. So if you move to the next record, and the key change you made has caused your previous record to move to a new position in the sequence, the next record is selected according to the new sequence.

You can specify duplicate keys only if the file has been defined as allowing duplicate keys.

4.8 Searching Data Files

The F2=search function enables you to search for data strings in a file in either formatted or unformatted modes, and in either text or hexadecimal format.

In unformatted mode, the search is made for a string matching the search string. In formatted mode, the search is made for a field with a value matching the one you enter.

The three search functions are:

search-on-current-key For use with indexed and relative files only. It automatically selects the current key to search on.
search-on-key For use with indexed files only. It enables you to search for a particular record using its key value. It lists the available keys to search on and enables you to select one.
search In unformatted mode, it performs a string search. In formatted mode, it searches on the current field.

Pressing Ctrl+Break terminates a search.

4.9 Structure Selector

The Structure Selector enables you to include structures in records displayed in formatted mode.

When a program is compiled with the ANIM directive, an .idy file is created containing possible record structures for the files usd by the program. All 01-level items in the Working-Storage, File or Linkage Sections are considered candidates for record structures and are included in the .idy file.

You call the Structure Selector by pressing F8=structure-selector from the Alternate menu. When you do this, you are prompted to load an .idy file.

When the .idy file is loaded, it is displayed on the screen in the format shown in Figure 4-6. The currently-selected record structure, if any, is highlighted.



Figure 4-6: Structure Selector Screen

4.9.1 Assigning a Record Structure

You can assign a record structure to a record so that every time that record is displayed, it is displayed in that chosen structure.

To assign a structure, you move the cursor up or down the screen to the structure you require and then press one of:

F6=accept-default-structure Assigns the selected structure as the default structure for the record.

A message is displayed giving the character set to be used, which is the same as that in the .idy file, and depends on whether or not the .idy file was produced with the EBCDIC option set.

F7=accept-conditional-structure Assigns a conditional structure so that only records that match the conditions associated with this structure are displayed with that format. For example, you can set the condition so that the record structure is only applied to records where the first byte is equal to the value "1".

A window appears containing the structure you selected. You can now apply conditions to the elementary fields of this structure.

To define a condition, move the cursor to the required elementary field and press Enter. Define the condition value for this field and press Enter again.


Note: You can enter the value in either hexadecimal or text format.

When a condition has been assigned a field, the field has an asterisk (*) beside it.

When all the required definitions for the record are defined, press F7=accept-conditional-structure to commit the structure or Escape to disregard the structure. If you commit the structure, it appears in the Structure List box at the top right of the Structure Selector window. You can hide this box by pressing F5=structure-box.

Note that large arrays take some time to generate, and produce large .str files.

Example:

Consider the following example code extract:

 01 name.
     key-fld        pic x.
     first-name pic x(30).
     last-name      pic x(20).

 01 address.
     key-fld        pic x.
     street     pic x(50).
     town           pic x(20).

To create two conditional structures in this example:

  1. Select NAME from the Structure entry window by pressing F7.

  2. Select KEY-FLD from the Field window by pressing Enter.

  3. Enter the value "N" in the Field entry window.

  4. Press Enter to commit these selections and F7 to commit this structure.

  5. Select ADDRESS from the Structure entry window.

  6. Select KEY-FLD from the Field window by pressing Enter.

  7. Enter the value "A" in the Field entry window.

  8. Press Enter to commit these selections and F7 to commit this structure.

Now all records with "N" in the key field have the NAME structure applied to them and all structures with "A" in the key field have the ADDRESS structure applied to them, as follows:

NA.N.Other
A55 A Street    A town
NB.Bloggs
A32 A Long Street   A city

If the .str file has the same name as the data file, it is automatically loaded.

4.10 Creating a New File

Press F5=new-file on the Alternate menu, to display the Create File screen (see Figure 4-7).



Figure 4-7: Create File Screen

From this screen you can create any type of Micro Focus file. Some of the fields might not be highlighted, which means that either they are not relevant for the file type you want to create, or an entry into a corresponding highlighted field is required before they become highlighted and available. For example, only indexed files allow keys to be defined, so for every other file type, the fields relevant to keys are not highlighted.

To move around this screen, press either Tab or Backtab. To select an option, press Space; the cursor moves to the next available field.

To create a new file:

  1. Select a file organization from the drop-down list box

  2. Specify if the file is to be fixed-length or variable-length. If you select fixed-length, the minimum record length field is not available.

  3. Specify the record length(s)

  4. Specify the character set, either ASCII or EBCDIC

  5. If you want your file to use data compression, select the ON option.

  6. Specify the format of the file. The formats you can select are:

    Micro Focus format
    IDXFORMAT"4" format
    IDXFORMAT"8" format

  7. If the file is not indexed, press Enter to create the file. If the file is indexed, select F2=define-key to create keys for the file. The way you define keys is described in the section Defining Keys for an Indexed File below.

4.10.1 Defining Keys for an Indexed File

The F2=define-key function on the Create File menu enables you to define and change keys of the indexed file. The first Define Key screen displayed is for the prime key (see Figure 4-8). Subsequent Define Key screens are for alternate keys.



Figure 4-8: Define Key Screen

Press the Tab and Backtab keys to move forward and backward through the fields. Press space to toggle between Y and N values for the options.

Each key can have any of the following options set:

Key options:

Duplicates allowed If this key is to allow duplicate values.
Sparse character If this key is to have a sparse character, which you must specify.

Key compression options:

Leading spaces If leading spaces are to be compressed on this key.
Trailing spaces If trailing spaces are to be compressed on this key.
Duplicates If duplicates are to be compressed on this key.

You should then define the key range as a list. Each component has the format:

start:length

start Starting position of the key in the record; the first byte in the record is 1.
length Length of the key.

For example:

1:8,60:6

This example defines a split key with two components. The first component starts at byte 1 and is eight bytes long. The second component starts at byte 60 and is six bytes long.

You can now add the key to the key list by pressing Enter. The subsequent screens are for alternate keys.

When you have finished the key definitions, you press Escape, which commits all of the file definitions you have just made. You are returned to the Create file menu.

4.11 Functions

This section lists in alphabetical order the functions shown on the menus in the Data File Editor. Prompts and field names are included. The menus indicate which key you should press to invoke a function. For those functions that appear on submenus, the submenu is identified.


accept-conditional-structure

Assigns a conditional structure for the file. In formatted mode, all records that match the conditions are displayed with that structure.

Available on the structure-selector menu.

For more information, see the section Assigning a Record Structure.


accept-default-structure

Assigns the default structure for the file. In formatted mode, all records that do not match the conditions defined for conditional structures are displayed with the default structure.

Available on the structure-selector menu.

For more information, see the section Assigning a Record Structure.


ascend-level

In either compressed or expanded mode, if the cursor is positioned on a group item, the next higher level of that item is displayed.

Available on the structure-selector menu.


change-read-key

For indexed files, enables you to change the read key, which determines the sequence order for the records in the current file. If the current display is unformatted, the bytes that make up the key are highlighted.

Available on the Configuration Screen menu.


compress/expand

You can either expand the current group item so that all sublevels of that group item are displayed on the Structure Editing screen, or you can compress an expanded current group item so that only that level of the group item is displayed.

Available on the structure-selector menu.


copy-record

Insert a copy of the current record into the file. For an indexed file, this option fails if any key does not allow duplicates.

Available on the main menu.


create-file

Creates a new file.

You must first exit from any existing file by pressing Escape.

You enter the name of the file you want to create at the prompt on the screen, then press Enter. The Create New File window appears so that you can enter details of your new file.

Available on the Alternate menu.


delete-record

Deletes the current record.

Available on the main menu.


delete-structure

Deletes from the .str file the structure selected in the structure box. You are asked to confirm this action. If you respond with "Y", the structure is deleted.

Available on the structure-box menu.


descend-level

In either compressed or expanded mode, if the cursor is positioned on a group item, the next lower level of that item is displayed.

Available on the structure-selector menu.


directory

Enables you to use the Directory functions to locate your file.

Available on the load-file menu.


edit-structure

Enables you to edit the conditions for the structure selected in the structure box.

Available on the structure-box menu.


field/picture

Shows the picture definition of the data being displayed and the relative part of the data record containing the current field (position followed by length). This function is available only in formatted mode and is an alternative to Display-field-names.

Available on the Control menu.


file-info

Displays the Configuration Screen, which contains information on the currently loaded file. Figure 4-9 shows an example of such a display.

Available on the Alternate menu



Figure 4-9: Configuration Screen

Use the <up-arrow> and <down-arrow> to select a key in the key list box. You can examine any key in the box by pressing Space when it is highlighted.


go-to-byte

Asks you to enter the number of a byte in the record, then displays the record starting from that position.

Available on the Control menu.


go-to-Nth-record

Asks you to enter a record number, then performs a sequential read through the file until it reaches that record. This can take some time for very large files.

Available on the Control menu.


group-copy

Asks you to enter the number of times you want to copy the current record, then inserts the current record that many times below the current record. This function is not available for indexed and relative files.

Available on the record-group-edits menu.


group-delete

Asks you to enter the number of records you want to delete, then deletes that many records below the current record.

Available on the record-group-edits menu.


group-insert

Asks you to enter the number of times you want to insert a record, then inserts that many records below the current record. This function is available only for sequential files.

Available on the record-group-edits menu.


help

Provides help information for the current screen.

Available on all menus.


init-record

Sets the data in the record to default values. If a .str file is loaded, it is used to:

If no record structure is available, the record is filled with spaces.

Available on the main menu.


insert-record

In both unformatted and formatted modes, attempts to add a record to the current file. If a .str file is loaded, all of the available structures are listed for you to select. If a .str file is not loaded, a record containing spaces is inserted.

If you select a structure on a variable-length file, the structure length is used as the record length.

If the file is relative, you are prompted for the relative record number for the record. You are warned if you are about to overwrite an existing record.

If the file is indexed, the addition of duplicate key values is allowed only if they are allowed by the file definition. You are warned if you are adding a duplicate key. You are not allowed to leave the record until you include key values allowed by the file definition. The record is initially filled with spaces.

Available on the main menu.


list-structures-to-file

Lists information from the current .str structure file in a .lst file, suitable for printing. For each structure, the list contains:

Available on the structure-box menu.


load-file

Displays the Load File menu (see Figure 4-10).



Figure 4-10: Load File Menu

Type in the name of your file or select it using the directory function. If you specify a fixed-length record sequential or relative file, a panel appears prompting you for the record length. The Get File Header Information screen enables you to specify the file organization. An example of this screen is shown in Figure 4-11.



Figure 4-11: Get File Header Screen

For a description of the functions on the Load File menu, see directory, toggle-backup and toggle-character-set.


load-str-file

Loads a previously saved structure description file (usually with the same name as the data file and a file extension of .str). This file is used to format the current record when displayed in formatted mode.

Available on the Alternate menu.


nxt-rec

Makes the next record the current record. In unformatted mode, the next record is highlighted. In formatted mode, the fields in the next record are displayed.

Available on the main menu.


prv-rec

Makes the previous record the current record. In unformatted mode, the previous record is highlighted. In formatted mode, the fields in the previous record are displayed.

Available on the main menu.


record-group-edits

Enables you to edit a group of records. This function displays its own submenu. For a description of the functions on this submenu, see group-insert, group-delete, and group-copy.

Available on the Alternate menu.


repeat-srch

Repeats the last search requested. If you haven't attempted a previous search, an error message is issued. To interrupt a search, press Ctrl+Break.

Available on the Control menu.


save-as

Enables you to save the current file with a different name. When you do this, the new name is displayed at the top of the Data Editing screen.

Available on the Alternate menu.


save-file

Saves the file displayed on the Data Editing screen with its current name.

Available on the Alternate menu.


save-str-list

Saves the definition of your record structures as a file. This file should have the same name as the data file and a file extension of .str. When a data file is loaded, if a file with the same filename and the .str extension is found, it is automatically loaded also.

Available on the main menu.


search-on-current-key

Available only for indexed and relative key files; enables you to perform a search on the current (or read) key.


search-on-key

Available only for indexed and relative key files; enables you to search for a specified record.

This function lists the available keys and requests the key on which to search. You can search for records in either ASCII or EBCDIC mode.

Search-on-key displays its own submenu. For a description of the functions on this submenu, see search (=), search (>=), search (<=), search (>), and search (<).


search (=)

If the current file is an indexed file, search for a record with key equal to the value you specify.

If the current file is a relative file, search for a record with the relative record number equal to the value you specify.

You can enter the value either in text or hexadecimal format. You enter split keys as one concatenated string.

The value is searched for and, if found, the record containing that key becomes the current record (if the value is duplicate, the first record in the block of duplicate values becomes the current record).

Available on the search-on-key menu.


search (>=)

Similar to search (=) except the Date File Editor searches for a key or relative record number greater than or equal to the value you specify.

Available on the search-on-key menu.


search (<=)

Similar to search (=) except the Date File Editor searches for a key or relative record number less than or equal to the value you specify.

Available on the search-on-key menu.


search (>)

Similar to search (=) except the Date File Editor searches for a key or relative record number greater than the value you specify.

Available on the search-on-key menu.


search (<)

Similar to search (=) except the Date File Editor searches for a key or relative record number less than the value you specify.

Available on the search-on-key menu.


search

Search for a data string up to 512 bytes in length. A search string window is displayed, prompting you to enter a search string.

The search direction is displayed in the information line. By default, the search direction is forward. You can change this by pressing F2=toggle-search-direction.

In unformatted mode, the Data File Editor searches for a string matching the search string you entered. If the search string cannot be found, it displays the message:

could not find a matching string

In formatted mode, the Data File Editor searches for a field with a value matching the search string you entered. If the search string cannot be found, it displays the message:

could not find a matching field

To interrupt a search, press Ctrl+Break.


set-rec-len

For variable-length records only. Sets the length of the current record to the cursor position. If this length is less than the minimum length for the record, a warning is displayed and the request is ignored.

Available on the main menu.


structure-box

Displays the structure box, with its own submenu.

For a description of the functions on the structure-box menu, see delete-structure, edit-structure, and list-structures-to-file.

Available on the structure-selector menu.


structure-selector

Invokes the Structure Selector. This function enables you to load a .idy file and extract record structures from it to produce a .str file. You can then use the .str file to format records.

Available on the Alternate menu.

For a description of the functions on the structure-selector menu, see compress/expand, ascend-level, descend-level, structure-box, accept-default-structure and accept-conditional-structure.


toggle-backup

Switches file backup on and off. The display on the status line changes between "No Backup" and "Backup". When backup is on, the Data File Editor makes a backup copy of your file before any changes are allowed.

You must have sufficient disk space for a copy of your file to be made if you set the backup option on.

Your data file is copied to filename.dbk and, if the file is an indexed file, a copy is also taken of the index and named filename.ibk. filename is the name of your file.

If any mistakes occur while you are editing, these files can be copied back to your original names thus reversing any changes made while editing.

Available on the load-file menu.


toggle-character-set

Switches the character set of the current file between ASCII and EBCDIC.

Available on the load-file menu.


toggle-format

Switches the display of the current file between formatted and unformatted modes. This function is available only when you have created or loaded a .str file. Otherwise the file can be displayed only in unformatted mode.

Available on the main menu.


toggle-hex

Switches the display of the current file between hexadecimal and text modes.

Available on the main menu.


undo-edit

Restores the current record to the state it was in when it last became the current record.

Available on the main menu.


4.12 Data File Editor Messages

The messages displayed by the Data File Editor are either numbered or unnumbered. They are described in the following sections.

4.12.1 Numbered Messages

DFD001 File type is indexed, keys must be defined

You have tried to create an indexed file without defining keys for the file.

DFD003 No valid structure is available for this record

You have tried to apply a structure to a record which does not match any structure conditions.

DFD004 Could not find a matching field

A search of a formatted file has completed without being able to find a field that matches the target string.

DFD005 Could not find a matching string

A search of an unformatted file has completed without being able to find a match for the target string.

DFD006 First select a key from the key list

You have tried to select a key-related option without first specifying a key.

DFD012 Record required for formatted mode, please select one

You have tried to insert a record into the file in formatted mode without first selecting a record.

DFD014 File not found

The file specified could not be found in the directory specified.

DFD015 Cannot set record length to less than the minimum xxxxx

You have tried to set the record length to less than the minimum allowed.

DFD016 Your position is not in the permissible lengths for this record

You have specified a byte position which is beyond the end of the record.

DFD017 Record number beyond end of file

You have specified a record number which is beyond the end of the file.

DFD018 Record not added, invalid duplicate on key X

The file does not allow duplicate keys, but you have tried to add a record with a key that is identical to one that already exists in the file.

DFD019 Record length is not in the range 1 to 63488 (62K)

The record length you specified is not within the allowed limits for COBOL files of 1 through 63488.

DFD020 Minimum record length is greater than maximum record length

During the creation of a file, you have specified that the minimum record length is greater than the maximum record length.

DFD022 File format is unsuitable for file organization

During the creation of a file, you have selected an indexed file format with a non-indexed file organization.

DFD023 Component XX of key is invalid

During the creation of a key for a file, you have entered an invalid component for a key.

DFD026 Cannot edit, file is locked

You have tried to load a file that is locked exclusively.

DFD027 Cannot create, target file is locked

You have tried to create a file that is locked exclusively.

DFD028 Cannot save to file, file is locked

You have tried to save a file that is locked exclusively.

DFD030 Save failed, insufficient disk space

You have tried to save a file but there is insufficient disk space available.

DFD031 Back up failed. Could not open file

The backup you requested has failed. The source file could not be opened because it is locked.

DFD032 Back up failed. Could not create back up file

The backup you requested has failed. The target file could not be created because it is locked.

DFD033 Back up failed, insufficient disk space

You have tried to back up a file, but there is insufficient disk space available.

DFD035 Could not load, file is not a structure file

You have tried to load a structure file, but the file is not a valid structure file.

DFD038 Press Escape to clear current file before loading

You have tried to load a file before clearing the existing file by pressing Escape.

DFD039 Press Escape to clear current file before creating

You have tried to create a file before clearing the existing file by pressing Escape.

DFD040 Cannot go to end of file during loading

In full edit mode, the Ctrl+End function is available only when the file is loaded.

DFD041 Invalid filename

You have specified an invalid filename.

DFD042 File opened read only

You have tried to open a file for editing that another user already has open. You will not be able to save any changes you make to the file unless you save it with another name. However, we do not recommend that you do this as it can produce inconsistent results in the file.

DFD045 Index corrupt, use re-build before attempting to edit

You have tried to load a file which has an index which is corrupt. You can use the Micro Focus Rebuild utility to recover the index.

DFD046 Could not access help files

You cannot access any help files, either because Hyhelp is not available or because the Data File Editor .hnf file could not be found. Check if Hyhelp and the Data File Editor .hnf file are installed in your system.

DFD047 Structure is smaller than minimum record length, minimum used

You have tried to insert into a variable-length file a structure which is smaller than the minimum record length. The structure length could not be used to set the record length, so the minimum record length was used instead.

DFD048 Component XX of key is longer than maximum record length

A component of a key in a fixed-length indexed file is longer than the maximum record length.

DFD049 Component XX of key is longer than minimum record length

A component of a key in a variable-length indexed file is longer than the minimum record length. All keys should be less than or equal to the minimum record length.

DFD051 First specify item to search on

You have tried to repeat a search before defining your search target.

DFD052 Floating point can only be edited through hex

You have tried to edit a floating-point field when not in hexadecimal mode.

DFD053 Deletion failed: A record with the specified key could not be found

You have tried to delete a record with a key that does not exist in the file.

DFD055 Only deleted X records

You have tried to delete, as a group, more records than the number that exist below the current record. Only the records below the current record have been deleted.

DFD056 Could not find matching record

You have tried to search for a record but the key you specified was either invalid or did not match any records in the file.

DFD057 EXTFH module missing, could be data module compression missing

You have tried to access an EXTFH additional module that is not present. Check that the missing module is on the correct path.

DFD099 Insufficient memory to allocate for key block

There was not enough free memory to load the key information associated with an indexed sequential file. Check if you can remove any memory-resident applications to free up memory.

4.12.2 Unnumbered Messages

Alterations canceled

You pressed N after an update warning. The alterations applied to the current record have been canceled.

Could not load file, no idx file found

The index file for the indexed file specified could not be found, so the indexed file was not loaded. Check that the file name and path are correct.

Field has no children

You have tried to descend below the lowest level in a structure.

Field has no parent

You have tried to ascend above the highest level in a structure.

File exists, overwrite (Y/N)?

A file with the file name you specified already exists. Enter "Y" to overwrite the existing file, or "N" to enter a new filename.

Item has no children

You have tried to descend through a non-structured item.

Press Alt+F3 to load a file Alt+F5 to create a file

When the Data File Editor is initially loaded, it needs to be given a file to work with. Until a file is loaded, this message is displayed when any operation (except help or to load/create a file) is attempted.

Record already exists at this number, overwrite (Y/N)?

You have tried to insert a record into a relative file where the record number already exists. Enter "Y" to overwrite the existing record, or "N" to enter another number.

Search quitted

You have terminated a search before its normal completion by pressing Ctrl+Break

Structure larger than maximum record size, bytes beyond XXXXX ignored

The structure you have applied to the record is larger than the maximum record length. You can edit the record, but all changes beyond the maximum record length are ignored.

Unsaved file, exit (Y/N)?

You have tried to exit your file without saving the updates you made. Enter "Y" to disregard any updates, or "N" to return to editing so that you can save the file.

4.13 Structure Selector Messages

The messages displayed by the Structure Selector are either numbered or unnumbered. They are described in the following sections.

4.13.1 Numbered Messages

STRT001 Modifying structure

You have selected the edit-structure function from the Structure Box menu.

STRT002 Top of field list, no more fields

You have reached the top of the field list.

STRT003 End of field list, no more fields

You have reached the bottom of the field list.

STRT004 No structures stored

No structures have currently been defined. Use the F6=accept-default-structure and F7=accept-conditional-structure functions on the Structure Selector menu to define structures.

STRT005 Cannot add structure, no condition has been specified

You have tried to commit a conditional structure (using the F7=accept-conditional-structure function) before any conditions have been defined. Define conditions by selecting a structure item in the structure box, pressing Enter, entering conditional data, and pressing Enter again to add the condition.

STRT007 Default structure assigned

The default structure has been assigned to the record using the F6=accept-default-structure function.

STRT008 Default unaltered

You have tried to define a new default structure when one has already been defined.

STRT009 Structure deleted

The specified structure has been deleted.

STRT010 Deletion of structure aborted

You have aborted the deletion of the selected structure. The structure has not been deleted.

STRT011 Structure added

A conditional structure has been successfully added and now appears in the structure box.

STRT012 Structure edited

A conditional structure has been successfully edited.

STRT014 Update aborted, structure deleted

You have aborted the definition of a conditional structure. The structure has not been added.

STRT015 Field has no parent

You have tried to move above the highest-level item in the structure.

STRT016 Field has no children

You have tried to move below the lowest-level item in the structure.

STRT017 Structure list empty

You cannot access the structure list as no structures have been defined.

STRT018 Cannot select an information field

You have tried to select an informational field (for example, Working-Storage Section) as a conditional structure.

STRT020 Bad IDY file, could not load

You have tried to load a .idy file that does not conform to a recognized format. You might have syntax-checked the file with a Compiler prior to Micro Focus COBOL Version 3 .

STRT024 Could not load, file is not a structure file

You have tried to load a .str file that does not conform to a recognized format.

STRT025 Cannot edit conditions for default structure

You have tried to apply a condition to the default structure. Only conditional structures can have conditions associated with them.

4.13.2 Unnumbered Messages

Assumed ASCII character set for conditions

The conditions on this structure are entered in ASCII (defined by the type of compilation on the .idy file).

Assumed EBCDIC character set for conditions

The conditions on this structure are entered in EBCDIC (defined by the type of compilation on the .idy file).

Default structure has already been defined, alter it (Y/N)

You have tried to define a default structure when one has already been defined. Enter "Y" to confirm the new default structure or "N" to cancel.

Are you sure you wish to delete this structure (Y/N)

You have specified that you want to delete a structure. Enter "Y" to confirm deletion or "N" to abort the deletion.

Generating structure, please wait...

The structure you have selected is being generated. This can take some time for structures containing numerous or large arrays.

Listing structures to file

The defined structures are being listed to a file of the same name as the current file and with the .lst extension.

Unsaved structures, are you sure you wish to exit (Y/N)

You have tried to exit the Structure Selector without first saving the defined structures. Enter "Y" to exit without saving the structures, or "N" to abort the exit so that you can save the structures.



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

PreviousCOBOL Source Information Data File Editor TutorialNext