Business Process Automation

Business Number Checksum Algorithm

This page is accessed via Business Process Automation > Power Data > Business Numbers > Business Number Checksum Algorithm.

In many instances, key reference numbers, such as the PRO-number or Bill of Lading number, have a checksum digit to ensure the accuracy of the data. For example, when a Bill of Lading number is generated, it is sent through an algorithm to create a checksum digit, which is then appended to the number. If that Bill of Lading number is manually entered into a carriers system, the checksum digit can be calculated again and compared to the digit manually entered. This process helps to identify data entry errors.

Business Number Generator generates a base number and the checksum digit is then calculated and appended to the base number.

  1. Enter a name for the algorithm in the BN Checksum Algorithm ID field.
  2. Enter a Summary of the algorithm.
  3. Enter a Description.
  4. Enter a Class. The class is a Java class.
  5. Enter Class Parameters. These parameters are free format parameters of the Java class.
  6. Select a Domain Name for the algorithm.
  7. Click Finished.

Once a BN Checksum Algorithm has been created, you can specify the algorithm in your Business Number Rule. For example, you have a carrier with a Bill of Lading number structured as follows:

BL-nnnnn-s

where

  • BL is a prefix
  • - nnnnn is a pre-assigned number
  • -s is the checksum digit calculated by Oracle Transportation Management

To set up this Bill of Lading number, your Business Number Rule would look similar to:

BL-{nnnnn:id=1:start=10500}-{s:algorithm=SIMPLE_MOD:parameters=-divisor 7:algorithm_context=1}

Checksum algorithms are implemented as a Java class using the following Java interface:

public interface BNChecksum {public String compute(String baseNumber, String parameters);}

There are many formulas for calculating checksum digits. Oracle Transportation Management ships with several public formulas for calculating checksum digits. These are defined as:

  • ROADWAY: Divide base number by 11; subtract remainder from 11 to get check digit.  If the check digit is 10, use an X as the check digit. If the check digit is 11, use 0 as the check digit.
  • SIMPLE_MOD: Divide base number by some divisor; use modulus remainder as check digit.
  • UPS: Drop the Prefix (1Z, 3Z) from the base; convert letters in rest of base to a digit using the given table; sum all odd positions; sum all even positions and multiply by 2; add odd + even, divide by 10; subtract 1st digit of decimal remainder from 10. Conversion table: A = 2, B = 3, C = 4, D = 5, E = 6, F = 7, G = 8, H = 9, I = 0, J = 1, K = 2, L = 3, M = 4, N = 5, O = 6, P = 7, Q = 8, R = 9, S = 0, T = 1, U = 2, V = 3, W = 4, X = 5, Y = 6, Z = 7
  • US_CUSTOMS_ENTRY: Convert letters to numbers; starting from the rightmost digit, multiply odd position digits by 2, add 1 if result > 10, mod by 10, add together; add even position digits; sum the two numbers, mod that sum by 10, and subtract the units from 10; mod by 10 to get the checkdigit. Conversion table: A = 1, B = 2, C = 3, D = 4, E = 5, F = 6, G = 7, H = 8, I = 9, J = 1, K = 2, L = 3, M = 4, N = 5, O = 6, P = 7, Q = 8, R = 9,  S = 2, T = 3, U = 4, V = 5, W = 6, X = 7, Y = 8, Z = 9.
  • VICS_MOD: For positions 1-16, sum all the digits in the even-numbered positions and then multiply the result by three.  For positions 1-16 sum all the digits in the odd-numbered positions. Add the results of the previous two steps together. The check digit is the number required to round this number up to a multiple of ten. An example for setting up VIC BOL exists.
  • YELLOW_FREIGHT: Divide the last 6 digits of the base by 11 to get a decimal remainder. Looking at only the first 2 digits of the decimal remainder: if both are 0 ('00') then the check digit is '0', if the first digit is 0 then the check digit is 'X', else 10 - first digit only.

Related Topics