Shifting fields in table layouts

Concept Information

FIELDSHIFT command

Shifting fields allows you to correct field definitions that are displaced by a fixed number of bytes. This is only required if the table layout was incorrectly defined, or if changes have been made to the data source and you do not want to redefine your Analytics table.

If a data source has minor changes, such as an increased field length for one of the fields you have defined, you can shift the position of the subsequent fields and keep using the updated table layout. By shifting a field’s start position in a table layout, you automatically shift the start positions of all of the fields defined to the right of that field. Shifting fields only affects physical data fields.

Adjusting record length

When you shift fields in a table layout you may also need to adjust the Record Length value in the Table Layout Options tab if any of the following situations apply:

  • Changed field length If the length of a field in the data source has changed, you will first need to manually adjust the length of the corresponding field in the table layout, and you may need to adjust the record length in the table layout before shifting fields.
  • Field added If a new field has been added in the data source, you may first need to increase the record length in the Table Layout dialog box to accommodate the new field. Analytics does not allow you to shift fields if one of the shifted fields will extend beyond the current record length. Once the fields have been shifted, you can add the new field definition.
  • Field removed If a field has been removed from the data source, you need to delete the corresponding field in the table layout. After shifting fields, you may need to manually decrease the record length.

Shifted field definitions must remain within the record length

When you shift one or more field definitions right or left, the fields cannot exceed the record length in either direction.

Shifting fields moves both the specified field definition, and any field definitions to the right of the specified definition. If the shifted block of definitions would exceed the record length in either direction, an error message appears and the shift operation is not performed.

Tip

If the error message is appearing because you are exceeding the end of the record, try removing the final field definition to make room for the field definitions being shifted.

Shift fields in a table layout

  1. Select Edit > Table Layout.
  2. Click the Edit Fields/Expressions tab.
  3. Optional. If a data filter is defined for the table layout, you can choose to shift fields for a particular data filter only. Select the appropriate data filter from the dropdown list above the list of fields. Analytics displays only fields associated with the selected data filter, and these are the only fields that are shifted.
  4. Optional. If you want to start shifting fields from a particular field, select the field in the list of fields.

    The starting byte position of the field you select is prefilled in the Shift Fields dialog box.

  5. Click Shift Fields.
  6. In the Start Shifting Fields from position text box, keep the prefilled value, or specify the starting byte position of the first field definition you want to shift.

    All field definitions to the right of the specified field definition are also shifted.

    If you specify a non-starting byte position, the next starting byte position is used.

    Note

    non-Unicode Analytics 1 byte = 1 character
    Unicode Analytics, extended ASCII (ANSI) data1 byte = 1 character
    Unicode Analytics, Unicode data2 bytes = 1 character

    For Unicode data, typically you should specify an odd-numbered starting byte position. Specifying an even-numbered starting position can cause characters to display incorrectly.

  7. In the Shift fields by the following number of bytes text box, enter the number of bytes to shift the field definition.

    Enter a positive number to shift a field definition to the right. Enter a negative number to shift a field definition to the left.

    Note

    non-Unicode Analytics 1 byte = 1 character
    Unicode Analytics, extended ASCII (ANSI) data1 byte = 1 character
    Unicode Analytics, Unicode data2 bytes = 1 character

    For Unicode data, specify an even number of bytes only. Specifying an odd number of bytes can cause characters to display incorrectly.

  8. Click OK, and then click Yes in the confirmation dialog box.