Case Modification


Characters are copied from the source string to the result string as-is, unless you provide codes to modify the case of the data:


    • >   Case modification code causes all data placed in the result string from that point forward to be converted to upper case


    • <   Case modification code causes all data placed in the result string from that point forward to be converted to lower case


    • ><   Case modification code causes all data placed in the result string from that point forward have its case inverted such that ABCDwxyz will become abcdWXYZ. There can be no spaces between the > and < symbols.


    • <>   Case modification code causes all data placed in the result string from that point forward to resume being copied as-is without case modification. There can be no spaces between the < and > symbols.


    • When mapping commands are specified while a > , < or >< case modification code is in effect, certain commands may handle these codes differently or may disregard them. Consult specific commands for more information.


    • UC, LC, SC, TC and IC  case alteration command codes alter the current contents of the result string at the point the command is encountered, performing Upper Case, Lower Case, Sentence Case, Title Case and Invert Case operations, respectively, on the result string. Refer to the main Help guide for the Primary and Line commands of SC and TC to understand the capitalizations these perform.



Case Sensitivity and Case Conformance



When a string operand appears on a command code, and that command involves searching for or changing data, the command will apply comparison and change rules that are similar to how SPFLite in general handles this when it executes a FIND or CHANGE primary command.


Mapping commands handle case sensitivity as follows:


    • If you have provided no other indications on your mapping string as to how you want string searches to be handled, the mapping-string facility will use the current CASE setting from the PROFILE setting of the file you were editing when you issued the CHANGE command that contained a mapping string. If your PROFILE setting is CASE C, string comparisons will be done as case-sensitive; if your PROFILE setting is CASE T, string comparisons will be done as case-insensitive.


    • If you specify a mapping command code of CC or CT, it overrides the PROFILE CASE setting. If you specify a mapping command code of CC, string comparisons from that point forward will be done as case-sensitive, unless that is changed by a subsequent CT command. If you specify a mapping command code of CT, string comparisons from that point forward will be done as case-insensitive, unless that is changed by a subsequent CC command.


    • If you specify a string operand on a command code, and that string contains a trailing type code of C or X, it implies a case-sensitive comparison, which overrides any CT mapping command or PROFILE CASE T setting which may be in effect. If you specify a string operand on a command code, and that string contains a trailing type code of T, it implies a case-insensitive comparison, which overrides any CC mapping command or PROFILE CASE C setting which may be in effect.


Some commands, such as RA (Replace All) accept a two-part string operand syntax, consisting of a first and a second string value. Such commands involve both finding and changing data.


When data is changed with such commands, it is possible to cause such changes to occur in a case conformant manner, the same as is done when a CHANGE primary command has string operands with string type codes of T for both string‑1 and string‑2. See Case-Conformant Change Strings under Finding and Changing Data in the Help topic Working with SPFLite for more information on how the case conformant change process operates.


For mapping commands that use pairs of strings, these special operands work as shown below, using the RA command as an example, which use a pair of first and second string values.


You will see that there are a large number of cases. Instead of trying to memorize these cases, it is best to observe that, with few exceptions, mapping commands handle strings the same way as FIND and CHANGE primary commands do when their string-1 and string-2 operands use the same type codes. Where there are differences from the way primary commands handle this, those differences are highlighted in red.


Note that after an X value is converted to its character equivalent, it is treated like type C; that is, as case-sensitive for comparisons, and an X value is used as-is when specified as string-2.


#

Sample Command

String-1 type

String-2 type

How string-1 compared

How string-2 changed

1

RA'first=second'

omitted

omitted

Based on CC/CT command in effect, or on current PROFILE CASE setting

As specified, as if string-2 had a type code of C

2

RA'first=second'C

RA'first=second'X

C implied

X implied

C

X 

Case sensitive

As specified

3

RA'first=second'T

T implied

T

Case insensitive

Case conformant

4

RA'first'='second'C

RA'first'='second'X

omitted

C  

X

Based on CC/CT command in effect, or on current PROFILE CASE setting

As specified

5

RA'first'='second'T

T implied

T

Case insensitive

Case conformant.  Type T is implied for string-1 because without it, the case conformance of string-2 would serve no purpose.


6

RA'first'T='second'

T 

omitted

Case insensitive

As specified, as if string-2 had a type code of C. Note that type T on string-1 is not assumed for string-2

7

RA'first'T='second'C

RA'first'T='second'X

T 

T 

C

X

Case insensitive


As specified

8

RA'first'C='second'

RA'first'C='second'C

RA'first'C='second'X

RA'first'X='second'

RA'first'X='second'C

RA'first'X='second'X

C

C

C

X

X

X

omitted  

C 

X 

omitted 

C 

X 

Case sensitive

As specified

9

RA'first'C='second'

RA'first'C='second'C

RA'first'C='second'X

omitted 

omitted  

C 

X 

Based on CC/CT command in effect, or on current PROFILE CASE setting

As specified

10

RA'first'C='second'T

RA'first'X='second'T

C  

X  

T

T

Case sensitive

Case conformance is required for SPFLite compliance. In ISPF, the type T would be ignored.

11

RA'first':'second'

T implied.

Type T is always assumed.

T implied.

Type T is always assumed.

Case insensitive

Case conformant. When colon notation is used, type T is implied for both strings. If you combine this colon notation with non-type-T codes, their values are accepted as written (including X), but strings are still treated as case-insensitive and case-conformant.

12

RA'first:second'

RA'first:second'C

RA'first:second'T

RA'first:second'X

This is probably an invalid string specification. The colon does not delimit two strings, but is part of the data in the one and only string that is defined.


If used with type X, the hex data will be invalid.

omitted 

omitted

Based on CC/CT command in effect, or on current PROFILE CASE setting

The command does not define string-2, but only string-1. The : colon in string‑1 is not a delimiter but is ordinary data, and has no special meaning. For the RA command, this would be a string-delete request. In other commands, it may be a syntax error.





Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator