MOD_CHECK_TASK task descriptor
The MOD_CHECK_TASK task does one or more modulus checks on incoming table data to determine whether it is valid. For example, it can be used as a part of account number validation.
The task returns either SUCCESS or FAILURE in a results variable when it finishes its table lookup and modulus checks. It returns SUCCESS when the record was located during the table lookup and the modulus check passed. It returns FAILURE when the record was not located or the modulus check did not pass. For a failure, the ibmErrorResults field might also have a reason why the check did not pass.
| Field name | Required or optional | Description | Examples |
|---|---|---|---|
| intSourceData | Required | The value to run the modulus check against. This field is not part of the table data. |
|
| intInstitutionNum | Required | The institution number of the account to be validated. For Canadian accounts, this number is a 3-digit number. |
|
| intModCheckId | Required | Key value to determine which modulus checks to use. |
|
| ibmOrderBy | Required | Multiple modulus checks can be done for one modulus check ID. The order of the modulus checks is determined by the values that are specified in this field. This field is in the table data only. |
|
| ibmIntRequired | Optional | When this field is set to Y, the modulus check is active. When it is set to N, the modulus check is not active and passes automatically. |
|
| ibmSetModFormat | Required | The format of the incoming data. This field is used to parse which characters are used for the modulus check, which character (if any) is the check digit, and which characters can be ignored. See Table 2 for a description of the valid format characters. |
|
| ibmSetModAddToCheckDigit | Required | A value to add to the check digit (if applicable) before all the values are summed. For example, adding 1 to the value 9 becomes 0. |
|
| ibmSetModWeights | Required | A list of comma-separated modulus weight values that are used to multiply the extracted digits by when
the account number is summed. The number of values in this list must match the number of digits that are
extracted from the account. Ranges are also supported and are in the format low-high. Ranges are applied to the digits from right to left. |
|
| ibmSetModOption | Required | Indicates how all of the digits are summed. Valid values for this field are shown in the following list.
|
|
| ibmSetModulus | Required | The value to use for the modulus value. |
|
| ibmSetCheckDigitAlgorithm | Required | The algorithm to use to validate against the check digit. The digits must be extracted and summed
before the check digit can be used for validation. The algorithms are shown in the following list.
|
|
| Character | Used in modulus check | Character set | Multiplied with weights | Description |
|---|---|---|---|---|
| 9 | Yes | [0-9] | Yes | The character is used for the modulus check. The value of the character must be 0 - 9. |
| S | Yes | [0-9], space, empty | Yes | The character is used for the modulus check. The value can be 0 - 9, a space, or an empty cell. Spaces and empty cells are converted to a 0 for the modulus check. |
| C | Yes, when ibmSetCheckDigitAlgorithm is not blank. Otherwise, no. | [0-9] | No | The character to use as the check digit. The check digit must be 0 - 9. |
| - | No | [-] | No | Indicates the potential position of a dash. If no dash is at this position, the check continues with the next character in the pattern. |
| X | No | Any | No | The character is skipped, no matter what its value is. |
Task descriptor
<taskDescriptor name="ModCheck" type="MOD_CHECK_TASK">
<assignment field="intSourceData" type="string" value="123-454"/>
<assignment field="intInstitutionNum" type="string" value="002"/>
<assignment field="intModCheckId" type="string" value="1"/>
<assignment field="ibmIntRequired" type="string" value="Y"/>
<assignment field="ibmSetModFormat" type="string" value="999-99C"/>
<assignment field="ibmSetModAddToCheckDigit" type="string" value="0"/>
<assignment field="ibmSetModWeights" type="string" value="2, 1, 2, 1, 3"/>
<assignment field="ibmSetModOption" type="string" value="Products"/>
<assignment field="ibmSetModulus" type="decimal" value="11"/>
<assignment field="ibmSetCheckDigitAlgorithm" type="string" value="Remainder_Minus"/>
<dataName>ModCheckTable</dataName>
<useExitClass>modcheckuserexit</userExitClass>
</taskDescriptor>Modulus check workflow example
In this example XML, the value to run the modulus check against is in the intSourceData field. The value is 123-454. The MOD_CHECK_TASK task first tries to find a record that matches the passed in intInstitutionNum and has an intModCheckId value of 1.
ibmSetModFormat : 999-99C
intSourceData : 123-454
Extracted digits : 12345
Extract check digit : 4Do
not use this check as the only validation that is done against an account number because it validates the
account number only enough to extract the required digits.Extracted digits : 1 2 3 4 5
ibmSetModWeights : 2 1 2 1 3
Products : 2 2 6 4 15
ibmSetModOption (Products) : 2 + 2 + 6 + 4 + 15 = 29
ibmSetModOption (Digits) : 2 + 2 + 6 + 4 + 1 + 5 = 20
ibmSetModOption (Ones) : 2 + 2 + 6 + 4 + 5 = 19ibmSetModulus : 11
ibmSetModOption (Products) : 29
Modulus result : 29 % 11 = 7Modulus result : 29 % 11 = 7
ibmSetModulus : 11
Check digit : 4
Sum to the next 10 : 30
| Value of ibmSetCheckDigitAlgorithm | Calculation | Result of the modulus check |
|---|---|---|
| Blank | 7 != 0 |
Fail |
| Remainder | 7 != 4 |
Fail |
| Remainder_Minus |
11 – 7 = 44 = 4 |
Pass |
| Roundup_10_Minus_Sum |
30 - 29 = 11 != 4 |
Fail |
| Greater_Than_9_Adjust |
11 – 7 = 44 < 9, so no adjustment is done4 = 4 |
Pass |
- Remainder_Minus
- Greater_Than_9_Adjust
After a modulus check passes, the task searches for the next modulus check to do. This search is done by incrementing the ibmOrderBy field by 1 and then doing another table lookup. If no record is found, the MOD_CHECK_TASK task returns with SUCCESS because there are no more checks. If another record is found, that record must also pass the modulus check or this task returns FAILURE.