Arrays

When your rules need to use long lists of MCC codes, Merchant Countries, or other values, these values should be stored in a hotlist and referenced using the LookupList function. However, should you decide not to implement hotlists, Falcon Expert rules may include lists of values or arrays instead.

General guidelines for when to use a list of values and when to use an array are as follows:

  • A list of values should be used if there are 20 values or less.
  • An array should be used if there are more than 20 values and hotlists are not an option.
  • Arrays do not count toward the 4KB limit in GRL code.

Consider the following limitations to using arrays:

  • Only one array may be used in a decision rule.
  • You must outline the exact number of values in your array.
  • Each array value is identified by the value it, meaning "item," and an item number.
  • You must declare your array at the top of your rule, similar to declaring and using a variable.
  • If multiple arrays are needed for a decision rule, UDVs may be used. FICO recommends the use of a flag to indicate the value is on the list.
  • Some advanced functions will not work with arrays, therefore, arrays are designed for use with simple object property conditions, for example, it = CRTRAN25.mcc.

If your rule requires the use of multiple arrays, use a UDV for each. This will allow you to identify if the value on the incoming data field is in the array, or on the list. If so, it will populate a UDV flag with a value. If it is not on the list, it will populate the flag with an alternate value. It is up you to determine the UDV names, type, value of flag, and what items are contained in the array.

The following is an array that could be used in a rule that sets a UDV (SRVC_UDV_merCtryCodeArray) based on whether a merchantCountryCode value in a transaction exists in the array that is part of the rule.
MerCtryArray is a fixed array of 12 string initially
{
    it[0]="028";
    it[1]="040";
    it[2]="044";
    it[3]="056";
    it[4]="88";
    it[5]="203";
    it[6]="208";
    it[7]="214";
    it[8]="222";
    it[9]="246";
    it[10]="300";
    it[11]="316";
}

i is an integer;
i = 0;

notFound is a boolean;
notFound = true; 

while ((i < 12) and (notFound)) do { 
    if (MerCtryArray[i] = CRTRAN24.merchantCountryCode) then {
        SRVC_UDV_merCtryCodeArray = 1;
        notFound  = false;
    }
    else {
        SRVC_UDV_merCtryCodeArray= 0;
    } 
    i = i + 1;
}
  • www.fico.com