IBM Support

How to use period(.) and comma(,) as decimal separator in IBM Sterling B2B Integrator 5.2.5

Technical Blog Post


Abstract

How to use period(.) and comma(,) as decimal separator in IBM Sterling B2B Integrator 5.2.5

Body

A decimal mark(decimal separator) is a symbol that is used to separate the integer part from the fractional part of a number written in decimal form. These numbers are called as Real Numbers and these are the numbers that have decimal representations with finite or infinite sequence of digits to the right of the decimal separator. Different countries officially designate different symbols for the decimal mark. The choice of symbol for the decimal mark also affects the choice of symbol for the thousands separator used in digit grouping.

In mathematics the decimal mark is a type of radix point, a term that also applies to number systems with bases other than ten. Conversationally, the decimal point is commonly referred to as a "decimal dot.". But the General Conference on Weights and Measures held in 2003 declared and reaffirmed that a comma or a dot on a line can be used as decimal marker symbols.

An example of usage in countries using decimal separator as comma - 25,52
An example of usage in countries using decimal separator as point(period) - 25.52

In the above example, 25 is the integer part and 52 is the fractional part where as comma, period are the decimal separators.

The usage of comma(,) as a decimal separator is most common in European countries. In countries with a decimal separator as comma, the decimal point is also common as the "international" notation because of the influence of devices, such as electronic calculators, which use the decimal point. Most computer operating systems allow selection of the decimal mark and programs that have been carefully internationalized will follow this.

In IBM Sterling B2B Integrator 5.2.5, by default the translator uses the decimal separator defined in local settings of the Operating System(OS) where IBM Sterling B2B Integrator is installed.

If the decimal separator is defined as period(.) in local settings of the OS and a real number is fed to a numeric field through input then,
                                   -  the translator translates all the numeric fields which has period(.) as decimal separator without any failure.
                                   -  the translator fails to translate all the numeric fields which has comma(,) as decimal separator and throws an Incorrect format error. 

If the decimal separator is defined as comma(,) in local settings of the OS and a real number is fed to a numeric field through input then,
                                   -  the translator fails to translate all the numeric fields which has period(.) as decimal separator and throws an Incorrect format error. 
                                   -  the translator translates all the numeric fields which has comma(,) as decimal separator without any failure.   

If the real number is sent in a string field, the ATON function in IBM Sterling B2B Integrator Map editor can be used to convert strings into real numbers. Aton is one of the numeric functions and numeric functions enable you to convert one data type to another.

Syntax:
real = aton(string);
where:  real    = real number variable
         string  = string variable

If the decimal separator is defined as period(.) in local settings of the OS and a real number is fed to a string field through input then,
                                   -  the ATON function translates all the string fields which has period(.) as decimal separator to real number variables without any failure.
                                   -  the ATON function fails to recognize all the string fields which has comma(,) as decimal separator and returns the real number variables with a value zero(0).

If the decimal separator is defined as comma(,) in local settings of the OS and a real number is fed to a string field through input then,
                                   -  the ATON function fails to recognize all the string fields which has period(.) as decimal separator and returns the real number variables with a value zero(0).
                                   -  the ATON function translates all the string fields which has comma(,) as decimal separator to real number variables without any failure.

At this time of the article, one might believe that the translator can only accept only one decimal separator either comma(,) or a period(.) for one IBM Sterling B2B Integrator installation. One might be wondering what if some customers would want to use both comma and period as decimal separators in numeric fields based on their requirements.
We have a solution.  

Abiding to the standards, the behaviour of translator has been changed in IBM Sterling B2B Integrator 5.2.5_9 to use both comma and period as a decimal separator in the numeric field.

Customers who would like to use both the decimal separators need to add the parameter "storage.customerDefaultDecimalSeparator" to the translator.properties_b2b_base_ext file, which tells the translator what character to consider as decimalSeperator.

Follow this process to fix this issue.

1) Open the file translator.properties_b2b_base_ext.in
2) Add the entry below.
storage.customerDefaultDecimalSeparator="the decimal separator to be used apart from the one configured in the local settings of the OS"
For example:
storage.customerDefaultDecimalSeparator=,

or

storage.customerDefaultDecimalSeparator=.
3) Save the file
4) Run setupfiles.sh

Note-1: For EDI, Positional, and XML maps, one can also specify a decimal separator in the IBM Sterling B2B Integrator map in the Properties. This will let the map to use this decimal separator while reading the data but uses the decimal separator mentioned in local settings of the OS for aton().
Note-2: For SWIFT maps, Comma(,) is the default decimal separator as per SWIFT standards. The above property will not work in this case.
Note-3: The above property change is a global change which will effect all the maps.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS3JSW","label":"IBM Sterling B2B Integrator"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

UID

ibm11121715