Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL program using a UNICODE DB2 database

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sheela_aks

New User


Joined: 22 Dec 2006
Posts: 7
Location: Singapore

PostPosted: Wed Jan 10, 2007 11:58 am    Post subject: COBOL program using a UNICODE DB2 database
Reply with quote

Hi,
I have a program which works fine with the EBCIDIC DB2 database, and I would like to use the same program with a UNICODE DB2 database.

Is there anything specific I will need to do in a cobol program when using a UNICODE DB2 database?

I ask this because I get a -302 error when I run the program. The SQL which gives this error is as below. I am using Low and High values in the query, are they any different in a UNICODE database?

SELECT
CURRENCY_CODE ,
CCY_NAME ,
SHORT_CODE ,
STATUS ,
MAKER_ID ,
MAKER_TS
FROM
VC_CURRENCY_P
WHERE
( CURRENCY_CODE >= :CURRENCY-CODE-LOW
AND
( CURRENCY_CODE <= :CURRENCY-CODE-HIGH
AND
( CCY_NAME >= :CCY-NAME-LOW
AND
( CCY_NAME <= :CCY-NAME-HIGH
AND
( SHORT_CODE >= :SHORT-CODE-LOW
AND
( SHORT_CODE <= :SHORT-CODE-HIGH
AND
( STATUS >= :STATUS-LOW
AND
( STATUS <= :STATUS-HIGH
AND
( MAKER_ID >= :MAKER-ID-LOW
AND
( MAKER_ID <= :MAKER-ID-HIGH
AND
(
( CCY_NAME > :CCY-CCY-NAME )
)
ORDER BY
CCY_NAME ASC ;

The Low and High variables are defined in the working storage section with the same pic size as defined in the database. The values are set as LOW VALUE and HIGH VALUE respectively.

Any help is much appreciated asap since our project is getting delayed due to this issue.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 11, 2007 6:27 am    Post subject:
Reply with quote

Hi Sheela,

You might try setting the initial values to x'0000. . . .0000' and x'FFFF....FFFF' (for whatever the length) and see if that changes anything.

If this is seriously delaying your progress, i'd suggest
1. ensuring that each of the 5 fields is defined as a stand-alone key
2. writing 5 routines (one for each "where" field) and then doing "if" tests on the found set to discard any unwanted rows.

Depending on the activity and size of this table adding the keys may not be practical. If it is periodically added to, but those fields are rarely changed, the overhead would not be high. There would be some additional disk space required for the additonal keys.

Once you're over the "crunch", this might be revisited for a more elegant solution.

This will get more (and maybe better) replies in the DB2 forum (where i believe i saw it. . . .)

Please let me know if changing the code changes your results. If this routine is in many modules, you may want to make it a copybook.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us