Previous Topic: Line Commands for Editing Table StructureNext Topic: Edit the Contents of an Existing Table


Issuing the TJ and TS Line Commands

The TJ (Text Join) and TS (Text Split) line commands allow you to shift data easily when you insert or delete data in columns. For example, if you delete data from a column using the delete key for the ISPF/PDF editor, characters in that column that are beyond the right side your screen do not move into the space that data vacated. However, if you use the TJ command to delete characters, the characters in that column beyond the right border of your screen shift left.

The TJ line command works as follows:

Suppose that you are editing a column called CURRENT_STATE, which contains these characters:

REGION IS DOWN

You can use the TJ line command to delete text from this column and join the characters to the left and right of the deleted text. Which characters are deleted depends on where the cursor is when you issue the TJ command.

For example, the following table shows you how different cursor positions affect the outcome of a TJ command. The underscore represents the cursor position. On the second line of the table, the TJ command deletes the word IS because the cursor is on the first character of that word.

Column Contents

Result of TJ Command

REGION_IS DOWN

REGIONIS DOWN

REGION IS DOWN

REGION DOWN

REGION IS DOWN

REGION IDOWN

If you insert characters into a column using the insert key for the ISPF/PDF editor, characters to the right of the inserted characters do not shift beyond the right border of your screen. However, if you use the TS command to insert characters, CA OPS/MVS shifts the existing characters as far right as necessary to make space for the new characters. For example, the following table shows you how different cursor positions affect the outcome of a TS command. The underscore represents the cursor position.

Column Contents

Result of TJ Command

REGION_IS DOWN

REGION IS DOWN

REGION IS DOWN

REGION IS DOWN

REGION IS DOWN

REGION I S DOWN

Usually, when you issue the TJ and TS commands, the table editor shifts data in a column as far right as possible without deleting any non-blank characters. However, to shift data past the end of a column and delete the data, you can specify an optional value (a number from 1 to 9999) with TJ or TS.

You can also use the optional number value when you want to delete or insert a certain number of characters to the right of (and including) the current cursor position. For example, if you issue the command TJ6, the table editor deletes the character in the current cursor position and the next five characters to the right of the cursor.

The following table shows you the results of issuing the TJ command with numeric values:

Command

Cursor Position

Result of TJ Command

TJ4

REGION_IS DOWN

REGIONDOWN

TJ9999

REGION_IS DOWN

REGION (all characters to the left of the cursor are deleted)

The following table shows you the results of issuing the TS command with numeric values.

Note: The bar character (|) represents the end of the column.

Command

Cursor Position

Result of TS Command

TS2

REGION IS DOWN |

REGION I S DOWN|

TS99

REGION IS DOWN |

REGION I |

Both the TJ and TS commands affect only the data in the column where the cursor currently rests. Data in other columns does not change position. For example, suppose that you issue the command TJ99 but the current column contains only 12 characters. The TJ command deletes the character in the current cursor position and all characters to the right of the cursor in the current column. However, any characters in columns to the right of the current column stay where they are.