Data conversions between platforms


Because the mainframe usually operates on EBCDIC data and the BMC AMI DevX Workbench for Eclipse usually operates on UTF-8 data, it is often desirable to convert data being transmitted from EBCDIC-UTF8 or UTF8-EBCDIC depending on the direction of data flow. Data conversion is not required; however doing so allows textual data (such as source code, listings, documents) to be displayed properly on the receiving platform. Binary data is generally not suitable for conversion.

Data conversion operations are the responsibility of the application programmer. When designing the application you may choose to do data conversions in either on the mainframe back-end program, or in the client-side program. Or, conversions could be done on both platforms, for example whichever platform is doing a Send Data operation is responsible for converting the data prior to sending it. The choice is yours. When designing the programs you may also choose not to do any conversions, in which case your applications on both sides will have to handle the data appropriately.

If you choose to perform data conversions in the client program (the BMC AMI DevX Workbench for Eclipse-based side), then you could choose to use the Java International Components for Unicode (ICU)  (http://site.icu-project.org/). Discussion about using ICU in client programs is beyond the scope of this document as this document is intended to describe back-end programming.

In order to perform data conversions in the back-end program, services are available in the compiled languages as well as Assembly in order to perform this function. These services will convert data from one code page (CCSID) to another, or vice-versa. This this environment, you would use these services to convert your data from the code page in use on the mainframe (e.g., IBM-1047, IBM-037, or any number of EBCDIC code pages) to code page 1208, which is the code page number designating UTF-8. Data being received from the client workstation could be converted from UTF-8 (code page 1208) back to an appropriate EBCDIC code page.

In data conversions, consider the compiler’s code page option in any conversions, especially if you use literals in your source program. When the compiler processes your source code, any literals will be assumed to be in the compiler’s code page, which may or may not be the code page of your actual data that your program will operate on, and may or may not be the code page chosen when the BMC AMI DevX Workbench for Eclipse user signed-on to the mainframe. It may be necessary to specify the compiler’s code page option to alter the default compilation code page. These compiler options are:

Language

Option

Cobol:

CODEPAGE(xxxx)

PL/I:

CODEPAGE(xxxx)

C:

LOCALE option, or an appropriate #pragma in the source code.

Assembler:

CODEPAGE(xxxx)

In the individual languages, the following services below are available for data conversions. Consult with the appropriate compiler’s language reference and programming guide documentation in order to learn how to use the services. The example programs provided with TPAPI also demonstrate one possible way of performing data conversions in each language.

Cobol

Use  the NATIONAL –OF( ) function in combination with the DISPLAY-OF( ) function in order to convert data from one code page to another. This is documented in the Cobol programming guide within the internationalization section, specifically the subsection titled “Processing UTF-8 data”.

PL/I

Use the MEMCONVERT( ) built-in function to accomplish code page conversions. This is described in the PL/I language reference documentation in the built-in functions section.

C

Use the ICONV( ) utility function to accomplish code page conversions. This is described in the C programming guide in the Code Set Conversion Utilities section.

Assembler

Use the Unicode Services character conversion service.  This is described in the IBM documentation z/OS Unicode Services User’s guide and Reference (SA22-7649). See Character Conversion section.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Enterprise Common Components 17.02