Custom data type

The Analytics Custom data type allows you to process data source fields that contain non-standard character data. For example, you can use the Custom data type to read data from foreign-language applications that implement certain characters in a non-standard or unsupported way.

The Custom data type stores ASCII values. However, you can create a file named custom.dat that maps non-standard or unsupported character values to standard ASCII character values.

Custom.dat file

Custom.dat is a standard text file with two values on each line. The first value is the non-standard or unsupported character to be replaced, and the second value is the ASCII character to replace it with. The values can be specified using any of the following methods, or combination of methods:

  • Character codes are specified using numeric values, such as 65 for the character ‘A’.
  • Hexadecimal values are specified using the two-character hexadecimal value preceded by an X, such as X41 for the character ‘A’.
  • Literal character values are specified using the character preceded by a C, such as CA for the character ‘A’.

The custom.dat file is read when you open Analytics, so you cannot edit the file while Analytics is running. None of the values specified in the custom.dat file should exceed 255, which is the largest value that can be stored in a byte. You can use any text editor to create or edit the custom.dat file.

Example

The data source field uses the hexadecimal values A4 for a dollar sign and A5 for a comma, and the character code 5 for a decimal point. You create a custom.dat file to substitute the required values. The file includes the following lines:

XA4 C$
XA5 C,
5 C.
  • first line substitutes the dollar sign ($) wherever the hexadecimal value A4 is encountered.
  • second line substitutes a comma wherever the hexadecimal value A5 is encountered.
  • third line substitutes a decimal point wherever the character code 5 is encountered.

Configure substitution rules for the Custom data type

Configure substitution rules for the Custom data type by creating a file called custom.dat that contains a list of characters that need to be replaced and the replacement characters.

Each time the Custom data type is selected for a field definition, the non-standard or unsupported characters listed in custom.dat are automatically replaced by the mapped ASCII equivalents. A single custom.dat file applies globally to all fields in Analytics projects that are defined using the Custom data type.

  1. Open a text editor and create a new file.
  2. Enter each substitution rule on a separate line using the following syntax:

    <type> character_to_replace <type> replacement_character

    • type – Specify C for character values or X for hexadecimal values. Do not specify a type for numeric ASCII character codes.
    • character_to_replace – Specify the character, digit, or hexadecimal value that you want to replace.
    • replacement_character – Specify the character, digit, or hexadecimal value that you want to substitute for the character_to_replace value.
  3. Save the file as custom.dat in the folder where the Analytics executable (ACLWin.exe) is installed.

    The default location is C:\Program Files (x86)\ACL Software\ACL for Windows <version>.

    The Custom data type can be used the next time you open Analytics. Whenever you use the Custom data type, it automatically applies the substitution rules that you have defined.