You are here: Defining Files and Fields > Editing Table Layouts > Shifting Physical Data Fields

Shifting Physical Data Fields

The Shift Fields command lets you easily correct field definitions that are displaced by a fixed number of bytes. By shifting a field’s start position in a table layout, you automatically shift the start positions of all subsequent fields to the right of that field. This makes it easy to edit Table Layouts when the linked external source data has changed.

The Shift Fields command operates on physical fields only. Computed fields are not affected.

Note: When working with a print file or other multiple-record-type file, you can choose to shift fields related to a specific record type only. To do so, select the appropriate predefined data filter from the fields/filter drop-down list on the [Edit Fields/Expressions] tab of the Edit Table Layout tab. Analyzer will then display only fields defined for that specific record type.

Before Shifting Fields

If a data field has been added to the source data file, you may first need to increase the record length in the Edit Table Layout tab to accommodate the new field. Analyzer 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.

If a data field has been removed from the source data file, delete the corresponding field in the table layout. After shifting fields, you may need to manually decrease the record length.

If a source data field has changed in length, you will first need to manually adjust the length of the changed data field and you may need to adjust the record length in the table layout, before shifting fields.

Using the Shift Fields Command

To shift fields, do the following:

1. From the Edit menu, select Table Layout. The Edit Table Layout tab is displayed.
2. Select the [Edit Fields/Expressions] tab to display a list of available input fields.
3. From the list of input fields, select the name of the leftmost field that you want to shift, then click [Shift Fields]. Analyzer displays the Shift Fields dialog with the start position of the selected field displayed in the upper text box.
4. Alternatively, you can click [Shift Fields] without first selecting a field, then enter the starting position of the leftmost field that you want to shift in the upper text box.
5. In the lower text box, specify the number of bytes you want the fields to shift. To move the fields to the right, enter a positive number. For example, if you want to move the field 4 bytes to the right, enter 4. To move the fields to the left, enter a negative number.
6. Click [OK], then click [Yes] to confirm the field realignment. Analyzer automatically redefines the field positions to the end of the related record.

Note: This command can also be used from the command line. For more information, see Fieldshift.