Operating System - HP-UX
1819974 Members
3456 Online
109607 Solutions
New Discussion юеВ

Convert DBCS ASCII to EBCDIC

 
Ajay_14
Occasional Advisor

Convert DBCS ASCII to EBCDIC

Hi.

I need to transfer some data from my HPUX server to AS400 server. HPUX uses ASCII format whereas AS400 uses EBCDIC format for its data.
The data that i have is DBCS Traditional Chinese.
We have a Data transfer application that will be doing the transfer from the unix box to AS400..
The problem that i am facing is that whenever i transfer the DBCS data either in ASCII or Binary format, it comes with junk characters in the AS400.
Can the DBCS ASCII data be converted to EBCDIC format on the unix box itself using some program or is there any tool available for this.
Thanx in advance...

Regds.
6 REPLIES 6
Francisco J. Soler
Honored Contributor

Re: Convert DBCS ASCII to EBCDIC

Hi,

Check it out this link, perhaps it could helps you.

https://aurora.vcu.edu/db2help/db2dm/frame3.htm#db2dm94

Frank.
Linux?. Yes, of course.
Massimo Bianchi
Honored Contributor

Re: Convert DBCS ASCII to EBCDIC

Hi,
i never used it, but from "man dd"


dd(1) dd(1)

conv=value [,value ...]
Where values are comma-separated symbols from the
following list.

ascii Convert EBCDIC to ASCII.

ebcdic Convert ASCII to EBCDIC.

ibm Convert ASCII to EBCDIC using an
alternate conversion table.

Massimo
Ajay_14
Occasional Advisor

Re: Convert DBCS ASCII to EBCDIC

Hi. Massimo,

Any idea as to where can i get the list for IBM conversion tables for the below option of DD.


conv=ibm Convert ASCII to EBCDIC
using an alternate conversion table


Also, can anybody provide me the syntax or sample for using DD for this purpose.

regds.
Massimo Bianchi
Honored Contributor

Re: Convert DBCS ASCII to EBCDIC

Hi,
looking at the man, you specify exactly one of the options ascii,ebcd,ibm, and the table is internal.

if you can get a short file, i suggest you to do a test, it's the fastest way.

Look also at this, always from "man dd":

EXAMPLES
Read an EBCDIC tape blocked ten 80-byte EBCDIC card images per block
into an ASCII file named x:

dd if=/dev/rmt/c0t0d0BEST of=x ibs=800 cbs=80 conv=ascii,lcase

Note the use of the raw magnetic tape device file. dd is especially
suited to I/O on raw physical devices because it allows reading and
writing in arbitrary block sizes.


ASCII and EBCDIC conversion tables are taken from the 256-character
ACM standard, Nov, 1968. The ibm conversion, while less widely
accepted as a standard, corresponds better to certain IBM print train
conventions. There is no universal solution.

Newline characters are inserted only on conversion to ASCII; padding
is done only on conversion to EBCDIC. These should be separate
options.


Massimo
Massimo Bianchi
Honored Contributor

Re: Convert DBCS ASCII to EBCDIC

Kevin Chapple
New Member

Re: Convert DBCS ASCII to EBCDIC

Hi,

I work at NIKE and I am working on the same problem (DBCS ASCII to EBCDIC FTP to AS 400). Have you found a solution yet? I would be curious what you find out. We are transferring double-byte (Japanese) flat files from SAP to our warehouse systems on the AS 400.

Best Regards,
Kevin