INSERTING CHINESE CHARACTERS INTO VSAM FILE



Help for IBM's record-oriented filesystem VSAM, ESDS, KSDS, RRDS, LDS and Storage management Subsystems

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby BillyBoyo » Thu Dec 15, 2011 2:23 pm

Thanks for the feedback. Let us know the resolution, please, as it might help someone else who comes across a similar problem.

Again, good luck and come back if there is something we might be able to help with.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby pals » Thu Dec 15, 2011 3:34 pm

sure:)
pals
 
Posts: 16
Joined: Thu Dec 15, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby pals » Fri Dec 16, 2011 10:22 am

I changed some encoding type in java...now,chinese charcters are reaching till cobol file..in my data, columns are separated by a special character.
when i try to unstring the data and try to retrieve the columns in a cobol file.that column which should contain chinese characters is blank,infact sometimes ,except one column,all other becum empty,how shud i resolve it?
pals
 
Posts: 16
Joined: Thu Dec 15, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby dick scherrer » Fri Dec 16, 2011 12:18 pm

Hello,

Suggest you create a bit of sample "input" data and look at it (post it here) using HEX ON. Actually, i'd create this test data with the editor and keep it very small. Then run your code to UNSTRING this and review the output using HEX ON (and post it here). Then post the COBOL code for the data definitions (input & output) and the UNSTRING(s).

When posting the code and the data, using the "Code" tag will preserve alignment and greatly improve readability. There is a Preview function so you can see your post as it will appear to the forum (rather than how it appears in the Reply Editor). When your post appears as you wish, Submit.
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

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby pals » Fri Dec 16, 2011 6:02 pm

Actuaaly,as output there is nothing to show,it is giving blank spaces only..what shud i do to make cobol understand the chinese characters.bcs i m feeling it is not able to read also.it is corrupting the file.as when i try with normal chars also.it is giving blank spaces.
pals
 
Posts: 16
Joined: Thu Dec 15, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby BillyBoyo » Fri Dec 16, 2011 6:27 pm

pals wrote:Actuaaly,as output there is nothing to show,it is giving blank spaces only..what shud i do to make cobol understand the chinese characters.bcs i m feeling it is not able to read also.it is corrupting the file.as when i try with normal chars also.it is giving blank spaces.


Are you saying that when you put "normal" English characters in, they are appearing in your VSAM file as blanks as well?

  1. Ensure that they are blanks, not just some non-displayable character
  2. If everything is blank, you have a program error in the program writing the record to the VSAM file
  3. Cobol doesn't have to understand Chinese or any language, it is just manipulating data. Your Chinese characters on the web are represented by one (probably more) byte of data with a particular value. Somewhere-along-the-way these bytes will arrive at your Cobol program, either still in ASCII-encoding or having been converted from ASCII to EBCDIC. The mainframe has different byte values than other systems (using ASCII) to represent the same logical value. Take the space character as an example. In ASCII this is x'20', in EBCDIC (on the Mainframe) it is x'40'. It will be the same for your Chinese characters. You have CODEPAGES to do translation to/from ASCII to EBCDIC.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby pals » Sat Dec 17, 2011 10:58 am

I can explain the situation like this:when i create a fresh vsam and enter a record having only english literals,it is fine.everything is visible.when i try to enter chinese characters,then problem starts,only one column is visible and others are blank or contain garbage value.
after that when i try to enter records which has only english characters,for it also,it gives same result...one column visible,all other blank.so i am thinking of reason behind this.
pals
 
Posts: 16
Joined: Thu Dec 15, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby dick scherrer » Sat Dec 17, 2011 11:56 am

Hello,

when i try to enter chinese characters
Explain in detail the steps you follow when you try this.
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

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby pals » Sat Dec 17, 2011 1:38 pm

Oki...i have created a java file.in this file ,,i pass a string like "1245~您好" to a method which creates a byte array from it.then further byte array is converted into string using utf-8,then furtheri create a bytearray from it using cp935 encoding.then passing this variable to commarea array variable and calling the cobol program using eci request ,while passing commarea variable as one of the parameter.then this hits mainframe.and do the insertion.then i check it in vsam file.
pals
 
Posts: 16
Joined: Thu Dec 15, 2011 12:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

Postby BillyBoyo » Sat Dec 17, 2011 1:45 pm

OK... so you've done lots of stuff at one end to enter the chinese characters - and just used z/OS with your normal Enlgish character-set at the other to see if they have arrived?

The values of a byte can be from 00 to FF (0-255). If you look at the hexadecimal values of the bytes on your VSAM record you should be able to relate them to the "cp935" (which I'm assuming is for the Chinese that you want) and hence back to their input byte values.

To see the Chinese on the mainframe you'll have to view the data with an application which is using a Code Page which will display Chinese characters for byte values, rather than English characters. This could be either to print or to a screen.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to VSAM/SMS

 


  • Related topics
    Replies
    Views
    Last post