There is a common solution in the IMS/DB world of substituting trailing spaces for string data types with a substitution character instead of trailing spaces. This was used in the past to help with performance over the wire (SNA and TCP/IP networks). While this solution might work well with 3270 screen emulators and other EBCDIC to ASCII applications, this does not fit well with the use of XML applications. The EBCDIC character used in IMS is an EBCDIC hex 3F (sub) character. This translates in ASCII as a question mark(?) which is a reserved character in UTF-8 for instance unless properly handled as part of a string. The behavior in our IMS/TM adapter treats this character as a XML delimiter and reports an error at runtime:

client.xmlError(doVerbSocketTransport.loadXml.2): Error -1072896760 (C00CE508); XML Parsing error on response document:

Reason: An invalid character was found in text content.

We have a workaround for this issue that can easily be applied.

Attached to this article and in text form below, is an Attunity Code Page text document. This code page can be compiled to create a binary that can be used in the configuration of a binding in the AIS installation on the IBM mainframe. The code page converts all EBCDIC characters below 0x40 to spaces except for the control characters for HT, FF, CR, SL, SI, and LF.
This includes the X3F substitution character.
To implement this code page on the IBM Mainframe do the following:

1.) FTP in ASCII the attached file to an 80 byte text file on the IBM mainframe.

2.) Edit the file and replace all the characters that the editor warns about (P'.') with "<" and ">" as start and end braces.(EBCDIC does not use the hard brackets that other platforms allow [ and ]). For instance:

.LANGUAGE. which is warned about in the editor should be changed to
<LANGUAGE>

3.) Execute the Attunity interface HLQ..USERLIB(NAVCMD). Once at a "Local>" prompt type the following command:

codepage 'YOURTEXTFILEANME'

where YOURTEXTFILENAME is the text code page file FTP'd to the mainframe.

4.) Exit out of the utility and use ISPF to list out the Attunity high level qualifier. A new binary file called HLQ..DEF.NGLISHCP should have been created.

5.) Go back into NAVCMD and issue the command at the Local> prompt:

edit binding NAV

Note: The binding NAV is the default. You may have configured the IMS/TM adapter on a binding of a different name.

6.) Find the XML tag for the environment setting "misc". Change the line to ad the following: (Note: you can add these anywhere on the line if other parameters exist.)

language='ENGLISH' codepage='NGLISHCP'

7.) Save the changes and exit the editor. When prompted by NAVCMD to import the changes reply "Yes".

8.) You will need to reload and refresh the current IBM Mainframe IRPCD daemon environment in order for these changes to take affect.


The IMS/TM adapter should now be able to handle the special character as a space now and properly parse the XML return result.

Text Codepage:


; This file defines the ALCEBCDIC language and related codepages for
; Attunity Products
;
; Custom character set to filter out non-stanard characters.
; All EBCDIC characters below 0x40 are set to spaces except:
; HT FF CR SL SI LF
;
; To generate the ALCEBCDIC.cp file from this file use the following command
; (example for Windows):
;
; $ nav_util codepage ALCEBCDIC.txt
;
; The ALCEBCDIC.cp file is written to NAVROOT/def.
;
; [LANGUAGE] - Section defining general language properties
;
; NAME - The name of the defined language used in the binding properties
; the name of the generated .cp file in the NAVROOT/def directory.
; BASE - The base codepage for the language. All codepage tables
; defined in this file relate to conversions to/from this base codepage.
; Usually, the base codepage is selected based on several considerations:
; - ASCII based (rather than EBCDIC based)
; - Common in use
; - Contain all required characters and symbols
; MS_WIN_CP - The Microsoft Windows codepage number to be used for this
; language. It must match the codepage used as the machine codepage in
; the environment definition.
;
[LANGUAGE]
NAME = ENGLISH
BASE = EBCDIC
MS_WIN_CP = 1252


; [CODEPAGES] - Section defining new codepages
;
; <codepage-name> = <conversion-table-name> - Each entry defines a new
; codepage and the conversion table to use for conversions from/to the
; base codepage. The tables mentioned here are defined later in this file.
;
[CODEPAGES]
CODEPAGE1 = CONVERSION1

; [DEFAULTS] - Section defining default codepages per platform
;
; <platform-name> = <codepage-name> - Each entry defines a default
; codepage for a platform. The last entry may specify the wildcard '*'
; as a platform to signify 'other platforms not specifically listed'
;
[DEFAULTS]
OS390 = CODEPAGE1

; [XML-ENCODING] - Section defining encoding names for use in generated
; XML documents
;
; <xml-encoding-name> = <codepage-name> - Each entry defines an XML
; encoding name for a given codepage name. Thus, if a codepage is in
; effect, the XML encoding name used is determined in this section.
;
[XML-ENCODING]
US-EBCDIC = CODEPAGE1

; [ALIAS] - Section defining codepage aliases.
;
; <alias-name> = <codepage-name> - Each entry of this form defines a
; codepage alias.
;
[ALIAS]
US-EBCDIC = CODEPAGE1

; [<conversion-table-name>] - Sections with the name of a conversion
; table define the conversion tables used for converting values between
; the base codepage and the defined codepage. There are as many sets of
; conversion tables (two per codepage) as there are codepages to map.
;
There are two tables defined per codepage:
; - The 'F' table (lines starting with Fi, i=0..F) describes the
; conversion From the base codepage to the defined codepage.
; - The 'T' table (lines starting with Ti, i=0..F) describes the
; conversion To the base codepage from the defined codepage.
;
; For example, consider the character 65 Dec (41 Hex) in the base
; codepage. To find its value in the defined codepage, look for the line
; starting with "F4 =" and find the 2nd value on the line (the first value
; refer to 40 Hex, the second to 41 Hex etc.).
; In a similar manner, to convert from the defined codepage to the base
; codepage, use the 'T' table.

; Conversion table Base_CodePage:ASCII -> ALC_EBCDIC
[CONVERSION1]
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
F0 = "20 20 20 20 20 09 20 20 20 20 20 0B 0C 0D 0E 0F"
F1 = "20 20 20 20 20 0A 20 20 20 20 20 20 20 20 20 20"
F2 = "20 20 20 20 20 0A 20 1B 20 20 20 20 20 20 20 20"
F3 = "20 20 16 20 20 20 20 20 20 20 20 20 20 20 20 20"
F4 = "20 20 20 20 20 20 20 20 20 20 5E 2E 3C 28 2B 7C"
F5 = "26 20 20 20 20 20 20 20 20 20 21 24 2A 29 3B 5E"
F6 = "2D 2F 20 20 20 20 20 20 20 20 72 2C 25 5F 3E 34"
F7 = "20 20 20 20 20 20 20 20 20 2C 3A 23 40 27 3D 22"
F8 = "20 61 62 63 64 65 66 67 68 69 20 20 20 20 20 20"
F9 = "20 6A 6B 6C 6D 6E 6F 70 71 72 20 20 20 20 20 20"
FA = "20 7E 73 74 75 76 77 78 79 7A 20 20 20 20 20 20"
FB = "20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20"
FC = "7B 41 42 43 44 45 46 47 48 49 20 20 20 20 20 20"
FD = "7D 4A 4B 4C 4D 4E 4F 50 51 52 20 20 20 20 20 20"
FE = "5C 20 53 54 55 56 57 58 59 5A 20 20 20 20 20 20"
FF = "30 31 32 33 34 35 36 37 38 39 20 20 20 20 20 20"

; Conversion table ALC_EBCDIC -> Base_CodePage:ASCII
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
T0 = "00 01 02 03 37 2D 2E 2F 16 05 15 0B 0C 0D 0E 0F"
T1 = "10 11 12 13 3C 3D 32 26 18 19 3F 27 22 1D 35 1F"
T2 = "40 5A 7F 7B 5B 6C 50 7D 4D 5D 5C 4E 6B 60 4B 61"
T3 = "F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 7A 5E 4C 7E 6E 6F"
T4 = "7C C1 C2 C3 C4 C5 C6 C7 C8 C9 D1 D2 D3 D4 D5 D6"
T5 = "D7 D8 D9 E2 E3 E4 E5 E6 E7 E8 E9 BA E0 BB B0 6D"
T6 = "40 81 82 83 84 85 86 87 88 89 91 92 93 94 95 96"
T7 = "97 98 99 A2 A3 A4 A5 A6 A7 A8 A9 C0 4F D0 A1 07"
T8 = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
T9 = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TA = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TB = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TC = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TD = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TE = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"
TF = "40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40"