Previous Topic Next topic Print topic


Adding Records

The methods for adding records are different for sequential, indexed, and relative files because sequential files do not have keys, and relative and indexed files have different types of keys. Also, special considerations apply to VSAM ES files.

Sequential Files

You can insert a new record either before or after the currently selected record.

You can also create new records by:

  • Copying an existing record once.
  • Copying an existing record many times. This technique is known as multiple repeat. It is a fast way to set up test data in a sequential file.

Indexed Files

You can add a new record to an indexed file by either creating a new record or copying an existing record. The line number displayed in the Data File status bar is reset to zero. For more information, see Navigating Data Files.

When you add an indexed file record, you must specify all unique keys for the new record. The prime key should always be a unique key. In some cases, a file might also have one or more unique alternate keys.

If you are inserting records with record layouts loaded, any key information that you specify during the insert process takes precedence over conditional data associated with the selected record layout. For more information about record layouts, see Record Layout Editor.

Relative Files

You can add a new record to a relative file by either creating a new record or copying an existing record.

When you add a new record, you must provide a relative record number so that Data File Editor can position the new record in the file. The line number displayed in the Data File status bar is reset to zero. For more information, see Navigating Data Files.

If you have not loaded any record layouts, Data File Editor uses the appropriate padding byte and sets the record to:

  • The minimum record length for variable-length files
  • The maximum record length for fixed-length files

VSAM ES Files

You can only create a new record in a VSAM ES file (often known as an ESDS file) by appending an empty record to the end of the file. If the file has alternate indexes, you must also supply any unique key values.

The new record is always positioned physically at the end of the file. If the file has alternate indexes, the empty record appears in the editing window in the position in the file dictated by the key of reference. For more information, see Navigating Data Files.

Once the record has been appended, you specify the field values in an editing session.

Previous Topic Next topic Print topic