Page 2 of 2

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Thu Dec 15, 2011 2:23 pm
by BillyBoyo
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Thu Dec 15, 2011 3:34 pm
by pals
sure:)

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Fri Dec 16, 2011 10:22 am
by pals
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?

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Fri Dec 16, 2011 12:18 pm
by dick scherrer
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Fri Dec 16, 2011 6:02 pm
by pals
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Fri Dec 16, 2011 6:27 pm
by BillyBoyo
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Sat Dec 17, 2011 10:58 am
by pals
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Sat Dec 17, 2011 11:56 am
by dick scherrer
Hello,

when i try to enter chinese characters
Explain in detail the steps you follow when you try this.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Sat Dec 17, 2011 1:38 pm
by pals
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.

Re: INSERTING CHINESE CHARACTERS INTO VSAM FILE

PostPosted: Sat Dec 17, 2011 1:45 pm
by BillyBoyo
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.