Page 1 of 1

Storing Japanese characters into a DB2 table

PostPosted: Wed Feb 16, 2011 3:02 pm
by kapra75
Hi

We have a requirement to store Japanese characters into a Db2 table.

How we can insert Japanese characters into a DB2 table using a COBOL-DB2 program?

I would like to know the procedure from start to end. I went through IBM documentation but it was too complicated for me to understand.

As a developer, what is the procedure to insert Japanese characters into a Db2 table using COBOL-DB2 program?

thanks
KP

Re: Storing Japanese characters into a DB2 table

PostPosted: Wed Feb 16, 2011 6:46 pm
by GuyC
Where do the japanese characters come from ? a file, a screen, ....
Do you have a unicode DB2 table ?
how hard can it be :

set column Col1 to 日本
01 Y pic N(10) usage national.
. . .
    Move NX"65E5 672C" to Y

    exec sql update table1 set Col1 = :Y where ...
    end-exec

Re: Storing Japanese characters into a DB2 table

PostPosted: Thu Feb 17, 2011 3:37 pm
by kapra75
Thanks for the response.

The Japan chars come from a file. We dont have a Unicode Db2 table yet.

can we create a database like this?
CREATE DATABASE dbname USING CODESET IBM-932 TERRITORY JP
are the codeset IBM-932 and territory JP correct? We are using Z/OS operating system.

How to create a sample Unicode table?

Re: Storing Japanese characters into a DB2 table

PostPosted: Thu Feb 17, 2011 4:00 pm
by NicC
I do not know so I would first check the manual for correct syntax and then try the command under SPUFI.

Re: Storing Japanese characters into a DB2 table

PostPosted: Thu Feb 17, 2011 9:43 pm
by GuyC
your database doesn't matter. it is your tablespace

the CCSID of the database is only a default

CREATE TABLESPACE tsxxx IN dbxxx CCSID UNICODE
CREATE TABLE tbxxx ... IN dbxxx.tsxxx


I don't know how you would tell in JCL or in COBol the input is in a certain codepage