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
 

 

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 BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am


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