The system function SysLib.calculateChkDigitMod11 places a modulus-11 check digit in a character item that begins with a series of integers.
SysLib.calculateChkDigitMod11( text anyChar inOut, checkLength SMALLINT in, result SMALLINT inOut)
This item has 4 digits and is either of type SMALLINT or is of a type BIN, with no decimal places.
You can use SysLib.calculateChkDigitMod11 in a function-invocation statement.
SysLib.verifyChkDigitMod (myInput, myLength, myResult);
6 x 2 = 12 8 x 3 = 24 1 x 4 = 4 2 x 5 = 10 6 x 6 = 36 6 x 7 = 42 5 x 2 = 10
(12 + 24 + 4 + 10 + 36 + 42 + 10) / 11 = 138 / 11 = 12 remainder 6
11 - 6 = 5
If the remainder is 0 or 1, the check digit is 0.
56621865
Related concepts
Syntax diagram for EGL functions
Related reference
EGL library SysLib