IBM Support

How to use the codepage function when sending data from Connect:Direct z/OS to Connect:Direct for Windows

Troubleshooting


Problem

When sending data from Connect:Direct z/OS to Connect:Direct for Windows EBCDIC to ASCII translation should be done using the codepage function.

Environment

Codepage function

Resolving The Problem

Here is a sample process showing 2 options of how translation using the 'codepage' function could be done:

COP2NT PROCESS SNODE=CDWINDOWS
STEP1 COPY FROM (DSN=YOURHLQ1.CODEPAGE.TEST.FILE -
DISP=SHR ) -
TO (DSN='C:\CODEPAGE.TEST.TXT' DISP=RPL -
SYSOPTS="CODEPAGE(20273,65001)" ) -
CKPT=1M
STEP2 COPY FROM (DSN=YOURHLQ1.CODEPAGE.TEST.FILE -
SYSOPTS="CODEPAGE=(IBM-273,UTF8)" -
DISP=SHR ) -
TO (DSN='C:\CODEPAGE.TEST1.TXT' DISP=RPL -
SYSOPTS="DATATYPE(TEXT) XLATE(NO)" ) -
CKPT=1M



In STEP1 the translation will be done on the Windows (TO) side using:

CODEPAGE(20273,65001)


20273 is the codepage name on the Windows side for the EBCDIC codepage IBM-273 that was used to create the file on the mainframe side and this is how the data are received on Windows during the transfer.


65001 is on Windows the equivalent name for the codepage UTF8 and this is how the data are finally stored in the destination file.

So Windows is receiving the data in EBCDIC IBM-273 and doing a translation to UTF-8 before writing the data to the file.



In STEP2 the translation is done on the mainframe (FROM) side using:

CODEPAGE=(IBM-273,UTF8).

The data will be read with IBM-273, then translated and sent to Windows in UTF8.

Here you have to be aware of the following:

Normally when data between Connect:Direct z/OS and Connect:Direct Windows are exchanged , by default an EBCDIC/ASCII or ASCII/EBCDIC translation will be done on Windows, side using the Connect:Direct internal translation tables, however we have already done the translation on the mainframe side and therefore no further translation should be done on Windows!

This can be achieved by coding these SYSOPTS for the Windows (TO) side:

"DATATYPE(TEXT) XLATE(NO)"

This means that the data will be handled in record mode, but no translation will be done.

So when now receiving the data (already translated to UTF8) only single records will be extracted and written to the file using the Windows record separators.

General note:

Although in my sample different codepages names were used and the codepage translation was done on different sides both destination files are generated identically.

The most common issue when using the 'codepage' function is to find the correct codepage pairs and the correct codepage names being available on the underlying OS where the translation should be done.

[{"Product":{"code":"SSFGBN","label":"IBM Sterling Connect:Direct for z\/OS"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Mapping and Translation","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"5.2;5.1;5.0","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
17 December 2019

UID

swg21976901