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
 
High and Low values in UNICODE database

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

New User


Joined: 22 Dec 2006
Posts: 7
Location: Singapore

PostPosted: Sat Dec 23, 2006 7:07 am    Post subject: High and Low values in UNICODE database
Reply with quote

Hi,
I have an issue with the selecting of records from a UNICODE DB2 database when using the high and low values. Can anyone let me know how I can read all the records in the database using high and low values. The query I used is

select * from VC_CURRENCY
where CURRENCY_CODE >= :WS-CCY-LOW and
CURRENCY_CODE <= :WS-CCY-HIGH ;

I am getting a -302 error when this query is executed. I have some double byte characters in this table and need to fetch them.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Sat Dec 23, 2006 12:08 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

How "CURRENCY_CODE" is defined in the table VC_CURRENCY

Also what is the definition for WS-CCY-LOW & WS-CCY-HIGH.
Back to top
View user's profile Send private message
sheela_aks

New User


Joined: 22 Dec 2006
Posts: 7
Location: Singapore

PostPosted: Mon Dec 25, 2006 2:22 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

The CURRENCY_CODE is defined as CHAR(3) and the WS-LOW-VALUE and WS-HIGH-VALUE is defined as LOW VALUE and HIGH VALUE respectively, in the working storage division of the COBOL program.


Please let me know if there is any restrictions for Numeric fields as well.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Dec 25, 2006 9:29 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

sheela,

SQL -302 :-
THE VALUE OF INPUT VARIABLE NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE

So what I meant to ask was... What is the PIC clause defined for WS-LOW-VALUE and WS-HIGH-VALUE.
Back to top
View user's profile Send private message
sheela_aks

New User


Joined: 22 Dec 2006
Posts: 7
Location: Singapore

PostPosted: Tue Dec 26, 2006 8:06 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

The size of the working storage fields are defined as CHAR(3), same as it is defined in the database.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Dec 26, 2006 10:50 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

Then atleast dont have any problem with length of the vars...

BTW, what does this query accomplish... could you explain little bit...
Quote:
select * from VC_CURRENCY
where CURRENCY_CODE >= :WS-CCY-LOW and
CURRENCY_CODE <= :WS-CCY-HIGH ;
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: Wed Dec 27, 2006 12:53 am    Post subject:
Reply with quote

Hello,

Would "select * from VC_CURRENCY" do what you need? If not, why not?
Back to top
View user's profile Send private message
sheela_aks

New User


Joined: 22 Dec 2006
Posts: 7
Location: Singapore

PostPosted: Mon Jan 08, 2007 4:45 pm    Post subject: Re: High and Low values in UNICODE database
Reply with quote

Hi,
Actually the given SQL is only a part of the complete where clause. The same condition is being checked for another 5 fields in the database. The idea is to use only one SQL query to fetch records even if only one of the fields have data as input. For eg. I have these 5 fields in the search condition on the screen (currency code, currency name, currency numeric code, currency char code and status). If I would like to fetch all the records which are of status 'ACT' then the other four fields will not have any input.

One way of achieiving this is to check if each of these fields are entered and based on the different permutations and combinations the where clause will have to be written.

To avoid this, we have written a generic query with low and high values so that this can be achieved with just one SQL query statment.

I hope I am being clear now. This single query works fine for the EBCIDIC database but does not work for the UNICODE database.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm

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