Changing the case of data

You can translate data to uppercase on input, or you can change the case of existing data to upper or lowercase.

The CAPS initially ON - translate changed data to uppercase (CAPS) option on the relevant Editor Options panel determines the initial setting of the "convert to uppercase" feature. Select this option if you normally want data entered in input fields converted into uppercase. Do not select this option if you want to enter lowercase or mixed-case data. This option also affects the processing of CHANGE arguments.

The CAPS and CASE primary commands control whether data in the data area is translated to uppercase on input (CAPS, CAPS ON or CASE UPPER), or left alone (CASE, CASE MIXED or CAPS OFF. As already mentioned, the initial setting of the "convert to uppercase" feature at the start of an editor session is determined by whether the CAPS initially ON - translate changed data to uppercase (CAPS) option on the Editor Options panel is selected or not.

The CASE UPPER, CAPS or CAPS ON commands are similar to the ISPF editor CAPS command. If you enter any of these commands, or the CAPS initially ON - translate changed data to uppercase (CAPS) option is selected (and no CAPS or CASE commands have been used in the current File Manager session):
  • If you overtype any data in a record, then:
    • In CHAR, HEX or LHEX display format, the entire record is translated to uppercase.
    • In SNGL or TABL display format, only the current field is translated to uppercase.
  • The CHANGE command treats the new (replacement) string as if it were specified in all uppercase except in these case:
    • The new string is enclosed in quotation marks, prefixed by the letter C (for example, C'New String')
    • The new string is specified as a hexadecimal string (for example, X'C1C2C3')

    If either of the above is true, then the new string is not translated to uppercase.

The CAPS OFF, CASE, and CASE MIXED commands have the same effect. If you enter any of these commands, or the CAPS initially ON - translate changed data to uppercase (CAPS) option is unselected (and no CAPS or CASE commands have been used in the current editor session):
  • Translation to uppercase is turned off.

Any CAPS command overrides any previously entered CASE command, and any CASE command overrides any previously entered CAPS command.

Note: In the ISPF editor with CAPS ON, a line is considered changed if you type anything on the line (if you overtype a space with a space, it is considered to be a change). However, in a File Manager editor session, overtyping a character with the same character is not considered a change.

You can change the case of existing data to uppercase or to lowercase, without having to input new data, by using prefix commands.

Caution: These prefix commands (LC, LCn, LCC, UC, UCn, UCC) affect all characters in a record, not just characters in those fields with an alphanumeric or character data type. This means that numeric data, such as binary data or packed decimal data, can be corrupted by using these commands.

To change existing data to uppercase:

  1. Position your cursor in the prefix area of the record that you wish to change.
  2. Type the UC or UCn prefix command, where n represents the number of records to be changed, or type UCC on the first of a block of records to be changed and UCC in the prefix area of the last record in the block.
  3. Press Enter. The records are changed to uppercase.

To change existing data to lowercase:

  1. Position your cursor in the prefix area of the record that you wish to change.
  2. Type the LC or LCn prefix command, where n represents the number of records to be changed, or type LCC on the first of a block of records to be changed and LCC in the prefix area of the last record in the block.
  3. Press Enter. The records are changed to lowercase.