C H A P T E R  5

Editing Records

The Record Editor enables you to add, modify, and delete records in a dataset that is displayed on the Data File Editor Menu. You can edit records in either hexadecimal or character format.

This chapter includes the following topics:


Starting the Record Editor


procedure icon  To Start the Record Editor

1. Start the region and make a client connection.

2. Display the Data File Editor Menu shown in FIGURE 5-1:

3. When the Data File Editor Menu is displayed, use the selection field (S) to select the file to edit.

All the fields and function keys on this screen are described in Accessing the Record Editor Functions.

  FIGURE 5-1 Data File Editor Menu Screen

Screen shot of the Data File Editor Menu screen.

4. Press PF9 to display the Record Editor screen shown in FIGURE 5-2.

The Dsn field, indicated by the arrow, shows the name of the dataset you are editing. To the right of the Dsn field is a field indicating the type of dataset (KSDS, ESDS, or RRDS). Also displayed are the record length (Rcd lth) and, for KSDS datasets, the key offset (key ofs) and key length (key lth).

  FIGURE 5-2 Record Editor Screen

Screen shot showing the Record Editor screen.

The following keys are active on the Record Editor main screen:

PF2

Changes the display format of the data in the Record key field from character to hexadecimal or vice versa; valid for KSDS datasets only.

If the Record key reads char, as in FIGURE 5-2, the data you type into the field is interpreted as characters. Similarly, if the description reads hex, as in FIGURE 5-3, you must enter the data in hexadecimal values.


  FIGURE 5-3 Record Editor--Hex Mode

Screen shot showing the Record Editor screen in hexadecimal mode.

PF3

Returns to the Data File Editor Menu.

PF4

Displays the Modify screen, which enables you to modify the record data. See Modifying Records in a Dataset.

PF6

Changes the byte offset into the record of the area you want to display. Note that the first field in the decimal column becomes unprotected. Type in an offset, then press the Enter key to change the offset or press PF3 to return to the Record Editor screen without changing the offset.

PF7

Displays the previous record in the dataset.

PF8

Displays the next record in the dataset.

PF9

Displays the previous 256 bytes of record data.

PF10

Displays the next 256 bytes of record data.

PF11

Adds records to the dataset. See Adding Records to a Dataset.

PF12

Deletes the current record. See Deleting Records From a Dataset.

Enter

Reads a dataset record using the key in the Record key field. For a KSDS dataset, you can specify a character or hexadecimal key. For an ESDS dataset, you specify an offset, and for RRDS dataset, you specify a record number. If the record you request is not found, the editor displays the next record in the file with a key greater than the key specified.



Modifying Records in a Dataset

The Modify screen is displayed when you press the PF4 key on the Record Editor main screen. You can modify the character area of the screen, the area of the screen on the right that is bounded by asterisks, or the hexadecimal area on the left, by pressing PF4 or PF5, respectively. The area of the screen that you can edit is then highlighted and unprotected.

  FIGURE 5-4 Record Editor--Modify Screen


The following function keys are active on the Modify screen:

PF2

Rewrites the record with the data you entered on the screen.

PF3

Returns to the Record Editor screen without modifying data.

PF4

Modifies the character section of the record displayed. The character display area bounded by asterisks is highlighted to indicate that the area is unprotected. You cannot modify the area of the record that contains the key to the file. An error message is displayed if you try to do this. FIGURE 5-5 shows the Character Mode Modify screen.

Press the Enter key on the Character Mode Modify screen to return to the Record Editor Modify screen, retaining any changes you made.

Press PF3 to return to the Record Editor Modify screen without retaining the changes.

You must press PF2 to write the changes to disk.


  FIGURE 5-5 Record Editor--Character Mode Modify Screen

Screen shot of the Record Editor modify screen in character mode. Text to be modified is shown in bold on the right of the screen.

PF5

Modifies the hexadecimal section of the displayed record. The hexadecimal area is highlighted to indicate that the area is unprotected. FIGURE 5-6 shows the Hex Mode Modify screen.

Press the Enter key on the Hex Mode Modify screen to return to the Record Editor Modify screen, retaining any changes that you made.

Press PF3 to return to the Record Editor Modify screen without keeping the changes.

You must press PF2 to write the changes to disk.


  FIGURE 5-6 Record Editor--Hex Mode Modify Screen

Screen shot of the Record Editor modify screen in hexadecimal mode.

PF6

Changes the byte offset into the record of the area you want to display. The first field in the decimal column becomes unprotected.

Type in an offset, then press the Enter key to change the offset. Or press PF3 to return to the Modify screen without changing the offset.

PF9

Displays the previous 256 bytes of record data.

PF10

Displays the next 256 bytes of record data.



Adding Records to a Dataset

To add records to a dataset, press PF11 on the Record Editor screen. The Add Record screen looks and acts like the Modify screen. However, data validation is performed when you add records. When the Add Record screen is displayed, type the new data. You can add records in the character area of the screen or to the hexadecimal area. Use the PF4/PF5 keys to choose the character/hexadecimal area.

Because duplicate keys are not allowed in KSDS datasets, you must edit the key to make it unique. The arrow on the right in the figure indicates the key. When you press Enter, the record key, indicated by the arrow on the left, changes to the new key.

  FIGURE 5-7 Record Editor--Add Record Screen

Screen shot of the Record Editor screen showing how a record is added. An arrow points to the Record key field, and another arrow points to the offset field.

The following keys are active on the Add Record screen:

PF2

Writes the record to the dataset. This function returns an error message if the record already exists.

Records are appended to ESDS datasets.

PF3

Returns to the Record Editor screen.

PF4

Displays the Modify screen, which permits you to modify the record data in character format. The processing is the same as that described in the previous section with the exception that you can modify the key for key-sequenced datasets.

PF5

Same as PF4, but allows you to modify the record data in hexadecimal format.

PF6

Changes the byte offset into the record of the area you want to display. The first field in the decimal column becomes unprotected.

Type in an offset and press Enter to change the offset.

Press PF3, instead, to return to the Add Record screen without changing the offset.

PF9

Displays the previous 256 bytes of record data

PF10

Displays the next 256 bytes of record data.



Deleting Records From a Dataset


procedure icon  To Delete a Record

1. Press PF12 on the Record Editor main screen to display the Delete Record screen.

  FIGURE 5-8 Record Editor--Delete Record Screen

Screen shot showing a record to delete on the Record Editor screen.

2. Press Enter to delete the displayed record.

Press PF3 to return to the Record Editor main screen without deleting the record.