Monday, July 8, 2013

Carrier Pro Number Generation in RedPrairie

Overview

In recent weeks, multiple people have asked me about generating check digits for carrier BOL or Pro Numbers.  Some customers were told that creating such logic will be a mod - so I wanted to document some of the standard features that are available in RedPrairie.  The information should be relevant to at-least 2009+ versions of RedPrairie DCS - maybe even earlier.

Carrier Pro Number Maintenance

RedPrairie provides a application called "Carrier Pro Number Maintenance" to define the pro number algorithms for the carriers.

This screen has a dropdown that shows the list of available algorithms.  These algorithms are defined in code master as column name of chk_dgt_mthd.

Currently several methods are available, for example:

  • Check digit routine for Yellow Transportation

    • Check digit routine for US Freightways
    • Check digit routine for Southeastern Freightlines
    • Check digit routine for Roadway Express
    • Check digit routine for Road Runner Freight Systems
    • Check digit routine for Pitt Ohio Express Inc
    • Check digit routine for Overnite Trucking
    • Check digit routine for Nations Way Transport
    • Check digit routine for Estes Express
    • Check digit routine for Con-way Central
    • Check digit routine for Circle Delivery Inc
    • Check digit routine for Arkansas Best Freightways
    • Check digit routine for American Freightways

    Under the Hood

    These components are under %SALDIR%\src\cmdsrc\salpronumber.  Policy SAL-SHIPPING/PRO-NUMBER/COMMAND-MAPPING maps the pro number codes (as defined in code master) to MOCA commands.

    The commands expect two arguments:
    • prefix
    • baseString
    To test any of these algorithms, you can call them with these two parameters.  It will return the check digit in a column called "checkDigit", e.g.

    calculate abf mod ten digit
    where prefix = '123' and baseString = '457'

    will return "9" as checkDigit

    The pronumbers are generated through MOCA Command "generate next carrier pro number" which in turn looks at the car_pro_num and related tables to get the next number, generate its check digit, and return the new pro number.  It also updates the internal tables so that the next pronumber can be generated with the next number in the sequence.

    Creating your own check-digit component

    First see if one of the existing ones would work.  Unfortunately you will not be able to see the source code since these are implemented in "C" or "Java" - but command documentation may still provide you enough details.  If one of the existing ones work, then you are done!  

    Otherwise to create a new one, follow the same convention with respect to input and output parameters for the command.  Create your command and add that to the code master and the policy.  Name your data with "usr" or "uc" prefix to make sure it is segregated from standard product offerings.