Unicode Implementation



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

Unicode Implementation

Postby nirmalandy » Thu Sep 16, 2010 8:21 pm

Hi All,

Can I get any document for unicode implementation in Cobol? Any help in this regard will be greatly appreciated.

Thanks.

~Anand
nirmalandy
 
Posts: 5
Joined: Thu Sep 16, 2010 7:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unicode Implementation

 

Re: Unicode Implementation

Postby Robert Sample » Thu Sep 16, 2010 9:02 pm

Check the COBOL Language Reference and Programming Guide manuals for what Enterprise COBOL supports. For example, the Programming Guide states
Using national data (Unicode) in COBOL

In Enterprise COBOL, you can specify national (UTF-16) data in any of several ways.

These types of national data are available:

* National data items (categories national, national-edited, and numeric-edited)
* National literals
* Figurative constants as national characters
* Numeric data items (national decimal and national floating-point)

In addition, you can define national groups that contain only data items that explicitly or implicitly have USAGE NATIONAL, and that behave in the same way as elementary category national data items in most operations.

These declarations affect the amount of storage that is needed.


I suspect your post is woefully inadequate in providing details. Unicode refers to an international standard that can be implemented in various character encodings such as UTF-8, UTF-16, ASCII, EBCDIC, and so forth. Enterprise COBOL National data supports Unicode in its UTF-16 character encoding. If you want something else, you need to either (1) open a problem report with IBM to find out what to do, or (2) accept that what you want to do is not possible on Enterprise COBOL and figure out a way to do it elsewhere -- or go back to whoever gave you the assignment and tell them it cannot be done as specified.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Unicode Implementation

Postby Lindovaldo » Thu Sep 16, 2010 10:05 pm

Hi

You can search for "what's the new in cobol for z/os".

Best regards,
Lindovaldo
 
Posts: 5
Joined: Thu Mar 11, 2010 11:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unicode Implementation

Postby nirmalandy » Fri Sep 17, 2010 3:13 am

Thanks for your responses.
I am sorry, I didn't give you clear picture.
We are implementing UTF-16 in our cobol stored procedures.We have defined the fields of stored procedures as N(XX) usage national and we have defined columns of DB2 tables as vargraphic.
We are using coprocessor for compilation. It's getting compiled also. However the unicode is defaulting to utf-8(CCSID = 1208). While executing, we are always getting SQLcode = -981.

We tried compiling without coprocessor and with precompiler also but still getting the same sql error of -981.
Sql code -981 means "THE SQL STATEMENT FAILED BECAUSE THE RRSAF CONNECTION IS NOT IN A STATE THAT ALLOWS SQL OPERATIONS"
Cobol version is enterprise cobol for Z/os 3.4.1
DB2 version is 9.1.5


Please let me know if you need more information.

Thanks.
~Anand
nirmalandy
 
Posts: 5
Joined: Thu Sep 16, 2010 7:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unicode Implementation

Postby Robert Sample » Fri Sep 17, 2010 5:58 am

I don't "do" DB2, but have you followed the manual's suggestion?
-981 THE SQL STATEMENT FAILED BECAUSE THE
RRSAF CONNECTION IS NOT IN A STATE
THAT ALLOWS SQL OPERATIONS, REASON
reason-code.
Explanation: The application attempted to execute an SQL
operation but the RRSAF connection was not in a state that
allows the processing of SQL statements.
System Action: The statement cannot be executed.
Programmer Response: See reason-code in “Section 4. DB2
Codes” on page 571 for an explanation of the problem.
Correct the error in the application, REBIND, and run the application
again.
Destination: 57015
since the manual specifically mentions an application error?

Have you cross-checked the CODEPAGE specified in the COBOL compile options against what is being used in the data base?
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Unicode Implementation

Postby nirmalandy » Fri Sep 17, 2010 7:56 pm

everytime we give Codepage as Unicode in the cobol compilation and it take UTF-8 always. Database is defined as UTF-16.
When we try to mention explicitly UTF-16 in compilation, compilation takes UTF-8.
We have been using coprocesser for the compilation wherein we don' have to precompile the program. We do a compile which in turns precompile and compiles the program and then we do a Bind. One point we noticed that our SQLCA was not getting expanded after compilation with UTF-8 or UTF-16.

Any sample cobol program implemented in UTF-16 and then compile and run JCL can help us.

Thanks.
~Anand
nirmalandy
 
Posts: 5
Joined: Thu Sep 16, 2010 7:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unicode Implementation

Postby Robert Sample » Fri Sep 17, 2010 8:39 pm

everytime we give Codepage as Unicode in the cobol compilation and it take UTF-8 always.
You make ABSOLUTELY no sense. The COBOL compiler option CODEPAGE requires a number parameter, not any words such as "Unicode". CODEPAGE(1140) must be specified for UTF-16 -- not CODEPAGE(UNICODE).

We have been using coprocesser for the compilation wherein we don' have to precompile the program.
Are you referring to a zIIP or zAAP co-processor? If not, what do you mean since "coprocessor" has very specific, highly limited meaning in the mainframe environment and none of the ways I'm used to seeing the word makes sense in your statement here.

I strongly recommend you contact your site support group and go through the COBOL Customization Guide with them, paying particular attention to everything discussed in Chapter 4, Customizing Unicode support for COBOL.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Unicode Implementation

Postby nirmalandy » Fri Sep 17, 2010 9:37 pm

You are right. I wrote unicode in previous posting to mean that we were passing ccsid. We mention codepage(1200) for UTF-16. You are saying it's 1140 which is actually default ( I think if you do not mention anything in code page it take 1140 as default).
I have very little knowledge of co-processor. I got that from one of the books. If we use national in our program; we have to use co-processor for compilation. We are not using precompilation step. I think Precompilation doesn't allow to set the code page.
I'll go thru the customization guide and will see if that helps.
Thanks.
~Anand
nirmalandy
 
Posts: 5
Joined: Thu Sep 16, 2010 7:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unicode Implementation

Postby Robert Sample » Fri Sep 17, 2010 10:45 pm

I was mis-reading the chart -- CCSID 1200 is UTF-16.

The Customization Guide has JCL in section 4.4 to generate conversion pairs -- which are required to allow you to use the UTF-16 code page in your program. This manual also indicates you must actually specify conversion pairs for DB2 as well as COBOL -- even if they are the same CCSID numbers. If your site support group has not generated these conversion pairs as required by your code, your COBOL code could be perfect and it still would not work. This is why I strongly recommend consulting your site support group -- setting up code pages is not something an applications group generally can -- or should -- do at a site.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post