How to transfer the EURO-sign € from EBCDIC to ASCII or vice versa?
The following instructions are valid for the EURO-sign and a specific EBCDIC codepage. When you want to transfer a different special character and/or use a different EBCDIC codepage the same instructions can be used but the claculations done in Step 4. will give different results.
So lets start:
- We have on EBCDIC Codepage 1140 the EURO-Sign represented as x'9F'
- We have on the ASCII Side the EURO-Sign represented as x'80'.
When you transfer a file from EBCDIC to ASCII (or vice versa) then translation need to be done for nearly all characters. Only one example: Number '0' is x'F0' in EBCDIC and x'30' in ASCII. To fulfill this task XCOM uses a hard coded internal code page. This internal page is used as long as INTERNAL_CONVERSION_TABLE=YES is specified in the xcom.glb on the Windows side. This is important: Any translation, regardless of the direction, is done on the ASCII-side of the transfer.
Here is what you need to do:
1. Specify
INTERNAL_CONVERSION_TABLE=NO
CODETABL=EUR
in the xcom.glb of your Windows XCOM.
2. Stop and start the XCOM Server on Windows.
3. In the subfolder /Convtab there are two files: atoe.tab (for translation from ASCII to EBCDIC) and etoa.tab (for translation from EBCDIC to ASCII). Create copies of each file and give them names which are identical but with the same three-character prefix, e.g. euretoa.tab and euratoe.tab. The prefix here is 'eur'; we need this in a moment.
4. Now open the euretoa.tab file. It contains 256 lines, each line contains a hexadecimal value. The value in the first line represents the character to which the EBCDIC value x'00' is translated to, this is 0x00. The value in the second line represents the character to which the EBCDIC value x'01' is translated to, this is 0x01 - and so on.
And where is our EURO-sign? In EBCDIC the EURO-sign is represented by x'9F'. This is the 160th character in the list (as x'9F' is 159 in decimal and we need to add 1 as the list starts with x'00' - which is decimal 0 - in line 1). Now go to line 160 and you find the ASCII value to which x'9F' will be translated - this is 0x50. When you do a transfer with no special translation table you will see that x'9F' is translated to x'50'. But we need to translate x'9F' into x'80' on ASCII as x'80' is the representation of the EURO-sign on ASCII. So change the value '0x50' to '0x80' in euretoa.tab and save the change.
4. On z/OS go into the XCOM Job and add CODETABL=EUR into SYSIN01. In parameter CODETABL you specify the prefix of the changed translation tables in Step 3. - I used EUR for this example.
5. Submit the job and you get the EURO-sign correctly translated to Windows.
6. For the opposite way, transferring the EURO-sign from Windows to z/OS, you need to chage the other translation table accordingly. Open the euratoe.tab file and change the 129th character in the list (The EURO is represented as x'80' which is 128 and you need to add one as x'00' is in line one, x'01' in line 2 and so on. The value in line 129 need to be replaced with 0x9F, the EBCDIC-representation of the EURO-sign.
7. Do a transfer from Windows to the Mainframe and specify parameter CODE_FLAG=EBCDIC for this transfer. Now you get the EURO-sign correctly transferred to the Mainframe.