On 11/28/22 10:07, Alain Benvéniste wrote:
Yes John ^ is the good character.
There is something i still don’t understand :
If i code
If £1==a
and a is equal to b3339
b for blank, the if is not honored
If I use a
If space(£1)==space(a) it works.
It could mean that when i do a set £1:=a the blank is removed… ?
Resiliency Services on Z Mainframe
[email protected]
== is the exactly equal operator. It operates on strings. So
(a == " 3339") and (a = 3339)
both evaluate to 1
In the numeric example, the string (a) is stripped of blanks and
converted successfully to a number for numeric compare.
There are a number of quirks with string operands.
literal 5|spec a: 1-* 1 if a==5 then ...
PIPSPX1086E Improper operand for string expression.
It fails because numeric constants are rejected with a string operator
(mea culpa). However a string function does not reject a numeric constant:
a==strip(5)
is processed OK with the result 0 because a has a leading blank, but 5
does not.