To convert DBCS Japanse file to Single Byte file.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

To convert DBCS Japanse file to Single Byte file.

Postby prasad75 » Thu Oct 13, 2011 2:46 pm

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.
prasad75
 
Posts: 3
Joined: Wed Oct 12, 2011 12:36 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Thu Oct 13, 2011 9:45 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post