IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

COBOL program using a UNICODE DB2 database


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Jan 11, 2007 6:27 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top