IBM Support

How to read the custom translation tables used in Connect Direct Server Adapter(CDSA).

Technical Blog Post


Abstract

How to read the custom translation tables used in Connect Direct Server Adapter(CDSA).

Body

The documentation in Sterling B2B Integrator to use the custom translation tables in the Connect:Direct Server Adapter is thorough and should help you to get you up and running with using the custom translation tables in CDSA. This blog entry is to show you how to read a custom translation table which should also help you in creating one.

A translation table is created in a grid (columns and rows) using the hex numeral system.

Here’s a sample translation table from ASCII to EBCDIC:

How do you read it?

The first column and first row, which are commented out with /* and */ in our example, make up the ASCII values in hex. Those values are not required to be present in the table, but for this blog purpose, it makes it easy to understand the positioning of the values. The items that are not commented out, the actual table itself, are the EBCDIC values in hex.

The rows and columns that are commented are what you’re translating from and the actual values of the table are what you’re translating to.  A table can also be EBCDIC to ASCII as well but for this example I’m using an ASCII to EBCDIC table.

Reference the following links for the hex values:

ASCII values in hex http://www.ascii.cl/htmlcodes.htm

EBCIDC values in hex https://en.wikipedia.org/wiki/EBCDIC_037

The ASCII hex value of the letter “a” is 61. If you intersect row 6 and column 1 (which makes up 61) you will see the hex value in EBCDIC which is 81. So the letter “a” in ASCII is 61 in hex and the letter “a” in EBCDIC is 81 in hex. See the following table where I highlighted the values.

 

Let’s do the “line feed” value now or LF for short. LF in ASCII is 0A hex. Look at row 0 and column A on the same table and the value in that position is 25.  So LF in EBCDIC is 25 hex, per this table.

 

To recap the documentation, SBI 5.2.4.1 or above allows CDSA to use custom translation tables embedded within the adapter. You create the translation table, save it to a file (i.e. sample-ascii-to-ebcdic.xlate). Reference it in the property file cdinterop-xlate.properties. For example, if the custom translation table is located in /path/to/xlate/table/files/sample-ascii-to-ebcdic.xlate then you reference in the cdinterop-xlate.properties as:

ascii-to-ebcdic-table=/path/to/xlate/table/files/sample-ascii-to-ebcdic.xlate

 

Finally add the LocalXlate and LocalXlateTable parameters to your CDSA CopyTo/CopyFrom Services:

 

<operation name="CD Server CopyTo Service">    

<participant name="CDServerCopyTo"/>    

<output message="CDServerCopyToServiceTypeInputMessage">

<assign to="RemoteFileName">/server/myfilename</assign>    

<assign to="BinaryMode">No</assign>    

<assign to="LocalXlate">Yes</assign>    

<assign to="LocalXlateTable">ascii-to-ebcdic-table</assign>    

<assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">

</assign>    

<assign to="." from="*"></assign>    

</output>    

<input message="inmsg">    

<assign to="CopyToResults" from="*"></assign>    

</input>    

</operation>

 

The LocalXlate should be set to Yes and the LocalXlateTable parameter should be set to the name of the translation table as defined in the cdinterop-xlate.properties file.

TIP: Remember the table file, in our example the file sample-ascii-to-ebcdic.xlate,  uses the c-style comments. This is different than other SBI property files which use the pound symbol #. The c-style comments begin with /* and ends with */

[{"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

ibm11121355