Trim Length (TRIML)
Instruction Syntax
Op Code (Hex) | Operand 1 | Operand 2 | Operand 3 |
---|---|---|---|
10A7 | Receiver length | Source string | Trim character |
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
- None
Lock Enforcement
- None
Exceptions
- 06 Addressing
- 0601 Space Addressing Violation
- 0602 Boundary Alignment
- 0603 Range
- 08 Argument/Parameter
- 0801 Parameter Reference Violation
- 0C Computation
- 0C0A Size
- 10 Damage Encountered
- 1044 Partial System Object Damage
- 1C Machine-Dependent
- 1C03 Machine Storage Limit Exceeded
- 20 Machine Support
- 2002 Machine Check
- 2003 Function Check
- 22 Object Access
- 2201 Object Not Found
- 2202 Object Destroyed
- 2203 Object Suspended
- 2208 Object Compressed
- 220B Object Not Available
- 24 Pointer Specification
- 2401 Pointer Does Not Exist
- 2402 Pointer Type Invalid
- 2E Resource Control Limit
- 2E01 User Profile Storage Limit Exceeded
- 32 Scalar Specification
- 3201 Scalar Type Invalid
- 36 Space Management
- 3601 Space Extension/Truncation
- 44 Protection Violation
- 4401 Object Domain or Hardware Storage Protection Violation
- 4402 Literal Values Cannot Be Changed