SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 62764: Some data-item values fail to match correctly when you include a LIKE operator in a Filter node or in calculated variable criteria

DetailsHotfixAboutRate It

When you set the criteria in a decision-campaign Filter node or a calculated variable, it is possible to select a LIKE operator.

The LIKE operator selects records by comparing character strings with a pattern-matching specification. The percent sign (%) is used as a wildcard and matches any sequence of zero or more characters. The underscore character (_) is also used as a wildcard and matches a single character.

Therefore, you can create criteria such as the following (this is a Filter node example):

Campaign.Name Like: %AB%

There is, however, a specific set of circumstances where the match incorrectly fails and the record is not selected. Those circumstances are met when all of the following are true: 

  • The pattern-matching specification includes the % sign.
  • The % sign is followed by one or more characters (as shown in the example above).
  • There is a partial match followed by a complete match.

So, in the example above, if the campaign name has a value of CXAB, then the record is selected as expected.

But if the campaign name has a value of AXAB, then the match fails and the record is not selected because there is a partial match with the first A in the campaign name.  

The workaround for this problem is to use the INDEX function instead of the LIKE operator, as follows:

  1. In your Filter node properties, click the Select data item icon. Then click the plus sign (+) sign to create a calculated variable.
  2. In the Calculated Variable Properties window:
    1. Enter a calculated variable name and description.
    2. Choose Boolean as the type.
    3. Insert this expression:
      INDEX(target-expression,search-expression)

      In this expression:

      • target-expression is the name of the data item that you want to filter on
      • search-expression is the character string that must be found in the data item in order for the record to pass the filter (for example, CXAB)

      The following expression is an example that shows values for target-expression and search-expression:

      INDEX(<<campaign.name>>, 'CXAB')
    4. Click OK. Then select the newly created calculated variable and click OK again.
  3. In the Filter node properties, click the Select value icon in the Values column and select Yes.
  4. In Filter node properties, click OK again to confirm the changes that you made in the Filter node.

There is a further but similar issue with a combination of the underscore (_) and the percent (%) wildcard characters in the pattern-matching specification.

Consider this example:

Campaign.Name Like: 2_%_

It is expected that if the campaign name has a value of 2000, then the match will be successful and the record will be selected. However, this match fails because the pattern-matching specification contains a percent sign (%) followed by an underscore (_). In this case (and in all similar cases—for example, 2123, 2ABC, and so on), the match incorrectly fails.   

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Real-Time Decision ManagerMicrosoft® Windows® for x646.39.4 TS1M1
Microsoft Windows 8 Enterprise 32-bit6.39.4 TS1M1
Microsoft Windows 8 Enterprise x646.39.4 TS1M1
Microsoft Windows 8 Pro 32-bit6.39.4 TS1M1
Microsoft Windows 8 Pro x646.39.4 TS1M1
Microsoft Windows 8.1 Enterprise 32-bit6.39.4 TS1M1
Microsoft Windows 8.1 Enterprise x646.39.4 TS1M1
Microsoft Windows 8.1 Pro 32-bit6.39.4 TS1M1
Microsoft Windows 8.1 Pro x646.39.4 TS1M1
Microsoft Windows 106.39.4 TS1M1
Microsoft Windows Server 20086.39.4 TS1M1
Microsoft Windows Server 2008 R26.39.4 TS1M1
Microsoft Windows Server 2008 for x646.39.4 TS1M1
Microsoft Windows Server 2012 Datacenter6.39.4 TS1M1
Microsoft Windows Server 2012 R2 Datacenter6.39.4 TS1M1
Microsoft Windows Server 2012 R2 Std6.39.4 TS1M1
Microsoft Windows Server 2012 Std6.39.4 TS1M1
Windows 7 Enterprise 32 bit6.39.4 TS1M1
Windows 7 Enterprise x646.39.4 TS1M1
Windows 7 Home Premium 32 bit6.39.4 TS1M1
Windows 7 Home Premium x646.39.4 TS1M1
Windows 7 Professional 32 bit6.39.4 TS1M1
Windows 7 Professional x646.39.4 TS1M1
Windows 7 Ultimate 32 bit6.39.4 TS1M1
Windows 7 Ultimate x646.39.4 TS1M1
64-bit Enabled AIX6.39.4 TS1M1
64-bit Enabled Solaris6.39.4 TS1M1
HP-UX IPF6.39.4 TS1M1
Linux for x646.39.4 TS1M1
Solaris for x646.39.4 TS1M1
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.