Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
No new posts COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us