How To Add A New Service Quantity Rule Algorithm

Warning:

This section is meant for technicians only!

If the SQ rule algorithms that are supplied with the base package are not sufficient for your rating requirements, you will have to write a new SQ rule algorithm. This section describes how to do this. After you have followed the steps outlined below, you can then set up the control tables necessary to invoke this algorithm as described under Setting Up Service Quantity Rules.

Warning:

Do NOT attempt to set up a new service quantity algorithm until you have a very good understanding of what your meters measure and how your rates charge for this consumption. In addition, you should completely understand the concepts described in UOM versus TOU versus SQI before creating a new algorithm. In addition, you should completely understand the concepts described in When And How To Manipulate Measured Consumption before creating a new algorithm.

Follow the following steps to define a new service quantity (SQ) rule:

  • Assign a two-digit identifier to the SQ rule. This identifier should begin with an X or Y. For example, you could give your first SQ rule the identifier X1, the second X2, etc.
  • Create an algorithm type for your new SQ rule. This algorithm type exists to define the types of parameters supplied to your SQ rule. Refer to Base Package SQ Rules for examples. This algorithm type must be identified by the two-digit identifier allocated above.

While SQ rules require an algorithm type, they do NOT require an algorithm. Why? Because you set up an SQ rule to define the values of the parameters passed to your program (and therefore you don't need an algorithm as algorithms exist to define the values of the parameters passed to a program).

  • Go to Look Up Options and add a new lookup value for the field SQ_​RULE_​FLG. This should have a Field Value equal to the two-digit identifier allocated above.
  • Write your new program. This program should be named CMPRQ 'nn' X - where 'nn' is the same two-digit identifier. When you create the new program, please copy an existing SQ rule program (their program names are all in the format CIPRQ_​_​X). This way you will automatically inherit the copybooks necessary to support the routine.
Warning:

Do NOT alter any of the copybooks contained in the linkage section of an algorithm. If you do need extra information for your algorithm you should execute SQL to get the information. If you do alter a linkage section copybook the upgrade process will be greatly complicated. Note, however, that virtually all information available to the rate application is being passed to the rule algorithms - so it is likely the information you need will be at hand.