Question & Answer
Question
exist(...) function doesn't work in combination with & operator in the Extended rules. *|* -57EED0C1665CFED985257917007BAEDE- *|*
Answer
Technote (troubleshooting)
Problem(Abstract)
exist(...) function doesn't work in combination with & operator in the Extended rules.
Symptom
exist(...) function when used as one of the operand for '&' operator it doesn't work. The expression is evaulated solely based on the other operand.
Ex:
if #TFH_RECORD_NUMBER != iSequenceNumber & exist(#TFH_RECORD_NUMBER) then
BEGIN
In the above expression "if" block will be executed if the first operand of '&' returns nonzero.
Error Messageno error message
Resolving the problem
All programming instructions and languages have an execution order and order of precedence. In this case:
if #TFH_RECORD_NUMBER != iSequenceNumber &
?????exist(#TFH_RECORD_NUMBER) then
The rule will be executed in the order given. It will evaluate if "#TFH_RECORD_NUMBER != iSequenceNumber".
Before doing this it will check if "exist(#TFH_RECORD_NUMBER)" which does not yield the correct result (and is not correct logic) when "#TFH_RECORD_NUMBER" has no value. The correct logic would be
if exist(#TFH_RECORD_NUMBER) &
?????#TFH_RECORD_NUMBER != iSequenceNumber then
Historical Number
NFX3643
Product Alias/Synonym
Escalation ID
1370914
Severity
Normal
Type
NormalFix
Was this topic helpful?
Document Information
Modified date:
12 October 2021
UID
ibm10766189