Compare To Pad (CMPTOPAD)

Bound program access

Built-in number for CMPTOPAD is 429. CMPTOPAD ( string : address of aggregate(*) pad : signed binary(1,4,8) - rightmost byte specifies the pad value OR unsigned binary(1) OR aggregate(1) string_length : unsigned binary(4,8) value which specifies the length of the string ) : signed binary(4,8) value which indicates if the string is lexically less than (-1), equal to (0) or greater than (1) a string of equal length which would be composed entirely of the pad byte value, replicated for the length of the string

Description  A logical (character) compare is done between the storage specified by string and the pad byte, which is logically replicated as necessary. If the first byte of the string is less than the pad byte value, the result is -1; if the string byte is greater the result is 1. If the bytes are equal the operation continues with the next byte of the string. This process is repeated until an inequality result is returned, or the number of bytes specified by string length have been compared. If all bytes compare equal, the result is 0. If the string length has a value of zero, the result is 0.

The string operand can point to storage containing values of any data type. The values will be interpreted as a logical character string. If the string operand points to storage which contains pointers, any pointer tags will not be taken into account, since this is strictly a byte comparison.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

22 Object Access

24 Pointer Specification

44 Protection Violation