Arithmetic comparison between numerical values in Vision Report
search cancel

Arithmetic comparison between numerical values in Vision Report

book

Article ID: 433478

calendar_today

Updated On:

Products

Vision:Report

Issue/Introduction

When using IF statements involving arithmetic fields, how do we compare values? Attempting to compare negative values in decimal format. This fails every time.

Environment

z/OS or VSE

Cause

Improper procedure for this function

Resolution

Arithmetic Comparison


When using IF statements involving arithmetic fields, comparison should be
done in packed decimal format. This is the only way to compare numeric values
with the signs of the two fields taken into account.

The following examples illustrate this point and also show the technique for
testing for negative and/or positive fields:


IF WST11-15-P IS LT P'0' /* Negative? (less than zero)
IF WST11-15-P IS GT P'0' /* Positive? (greater than zero) 

This is documentation from the Vision Report Reference Guide page 3-60