Please enable JavaScript to view this site.

COBSUB will subtract the parameters two to five from parameter one and pass the result back in parameter one. Note: A minus sign will be added as the last character of the result if it is negative - thus making COBSUBS obsolete.

The default is to pass the result back as a two decimal numeric field of length 12 [to include the minus sign].  The number of characters returned before the decimal point is always eight but you may alter the number of decimals by passing the value of 0 – 5 in parameter six. If you alter the number of decimals returned then the return value length will change accordingly from 9 – 15 [including the minus sign].

Note: If the number you pass into the program has a minus sign e.g. 1.10- then this number will be added i.e. subtracting a negative number will add it. If the end result is a negative number then a minus sign will be returned.

Parameter

In

Len

Out

Len

PARM1

Value 1

21

Result.

Return length depends upon value specified in PARM6 e.g.

xxxxxxxx.xxxxx-

xxxxxxxx.xxxx-

xxxxxxxx.xxx-

xxxxxxxx.xx-

xxxxxxxx.x-

xxxxxxxx-

15

PARM2

Value 2

21

-

 

PARM3

Value 3

21

-

 

PARM4

Value 4

21

-

 

PARM5

Value 5

21

-

 

PARM6

Position 1 = Number of decimals (0 - 5) or Blank for default of 2

Position 2 = Decimal point if not "." e.g.  ”,” (From version 7.0.0)

 

-

 

From version 7.0.0

Note: The second character of PARM6 can contain the decimal point character, if it is not a ". " e.g. a comma ",". The default will always be a ".". This character will be used for both the input and output values.