Trim Length (TRIML)


Op Code (Hex) Operand 1 Operand 2 Operand 3
10A7 Receiver length Source string Trim character
Operand 1: Numeric variable scalar.

Operand 2: Character scalar.

Operand 3: Character(1) scalar.

Description  The operation determines the resultant length of operand 2 after the character specified by operand 3 has been trimmed from the end of operand 2. The resulting length is stored in operand 1. Operand 2 is trimmed from the end as follows: if the rightmost (last) character of operand 2 is equal to the character specified by operand 3, the length of the trimmed operand 2 string is reduced by 1. This operation continues until the rightmost character is no longer equal to operand 3 or the trimmed length is zero. If operand 3 is longer than one character, only the first (leftmost) character is used as the trim character.

Operands 2 and 3 are not changed by this instruction.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0C Computation

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

32 Scalar Specification

36 Space Management

44 Protection Violation