Please enable JavaScript to view this site.

Navigation: Using the Cobwebb Designer > Useful Tips

Conditional Testing - Numeric versus Character

Scroll Prev Top Next More

The Numeric Test is only carried out if the test is Greater Than (GT), Less Than (LT), Greater than or Equal to (GE) or Less than or Equal to (LE).  Tests for Equal to (EQ) and Not Equal to (NE) are always assumed to be character tests. The maximum length of a numeric test is 10 characters.

Numeric Testing is used, for example, in checking the spooled file for an Item Number.  The Item Number could be ‘bbb1’ (b=blank) on the relevant line but the word ‘TEXT’ on another line. Using the numerical test ensures that only if a number (or blank) is found will the test be satisfied.

Numeric Test (GT LT GE LE)

1.Check if ‘Compare To Data’ (the fixed data) is Numeric i.e. 0-9.  If this is so then the test will be treated as Numeric. Note: If the data contains any non-numeric characters e.g. £,.$ then it will no longer be assumed to be numeric.

E.g. If 10 characters of data are to be compared, 10 numbers (e.g. 0’s) must be specified in the ‘Compare To Data’.

2.If the ‘Compare To Data’ is numeric check the ‘Compare Data’ (the variable data):-

a.Change ‘.’ and ‘,’ to ‘0’

b.Check if compare data is 0-9/Blank (NUMB)

If the above is true the field is numeric. This means that a ‘Compare To Data’ of ‘000000’ when compared to the ‘Compare Data’ of  ‘bbb123’ will be greater (even though the character value of a blank is less than zero).

If the above test is not true, the test will be character based using the IBM collating sequence.