Page 1 of 1

To convert DBCS Japanse file to Single Byte file.

PostPosted: Thu Oct 13, 2011 2:46 pm
by prasad75
We have a Japan file with DBCS chars that needs to converted to Single Byte file (SBCS).
Our aim is to convert DBCS characters to SBCS and keep the japanese charcters as is.

Input file format : .1.2.3.4.5.-7.8.9.|.J.A.P.N...F.M.T.|
in the first field, dot(.) refers to X'00' in hexadecimal format. where as in JAPN FMT field, we should not remove the dot(.) as it is part of japanese characters.

We tried with DISPLAY-OF and NATIONAL-OF functions with japan katakana CCSIDs. But it did not work.

MOVE FUNCTION DISPLAY-OF (FUNCTION NATIONAL-OF (INPUT-JPN-TXT, 300), 290) TO OUTPUT-FMT

300 refers to DBCS CCSID for Japan katakana
290 refers to SBCS CCSID for Japan katakana

Please help.

Re: To convert DBCS Japanse file to Single Byte file.

PostPosted: Thu Oct 13, 2011 9:45 pm
by dick scherrer
Hello and welcome to the forum,

Unless i misunderstand, the DBCS characters require 2 bytes and will never fit into 1 byte. . .

If you have 100 characters, how do you kno which ones are double and which are single?

Please show (in hex) a bit of sample input data and how you want the output (also in hex).

Use the Code tag to preserve alignment.