DISPTEST.cob:15: error: invalid target for REPLACING
That's totally logical, isn't it?
The first one is allowed, because TALLYING stores the result in TALLY, the second one isn't allowed, because you cannot change the value of an intrinsic function - UPPER-CASE(FIELD) is the target of REPLACING.
To do this you need to only have FIELD as target - as this can be changed, or two REPLACING clauses, or one CONVERTING:
Just seems illogical ??.
That's totally logical, isn't it?
The first one is allowed, because
TALLYING
stores the result inTALLY
, the second one isn't allowed, because you cannot change the value of an intrinsic function -UPPER-CASE(FIELD)
is the target ofREPLACING
.To do this you need to only have
FIELD
as target - as this can be changed, or twoREPLACING
clauses, or oneCONVERTING
: