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

How are low values and high vlaues stored in table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arraiyan.parveen
Warnings : 1

New User


Joined: 10 Feb 2010
Posts: 5
Location: chennai

PostPosted: Mon Oct 25, 2010 2:22 pm
Reply with quote

How are low values and high vlaues stored in table for Alphanumeric field

for eg : FRST_NM CHAR(15)

what is the value to be given for this field to test if this field has low values or high vlaues
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 25, 2010 2:33 pm
Reply with quote

you really need to do some reading.
this (and other subjects) are part of fundamental knowledge base
that you should have before you even start a job in computers.

high-value(s) and low-value(s) are COBOL figurative constants
and represent the internal storage of Hexidecimal X'FF' and X'00' respectively.

a column with datatype character can contain any of the 256 ebcdic hexidecimal values
(or 512 when the db2 is configured for UTF)

the test of a char column's value is the same regardless of the value being tested.

now, can you code in sql WHERE COL = Low-values
NO
but you can code your sql WHERE COL = :host-variable (where the HV contains low-values)
or WHERE COL = x'000000000000000000000000000000'
there are other syntax available, but suggest you find them yourself in the manuals,
hyperlinks (buttons) at the top of the page.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 25, 2010 5:29 pm
Reply with quote

this post appears to be the same as:
www.ibmmainframes.com/viewtopic.php?p=252559&highlight=#252559
and this:
ibmmainframes.com/viewtopic.php?t=51864

experience has shown that multibyte fields can often contain
1 low-value or high-value char and then spaces.

1st you need to determine if the complete 15 char are all binary zeroes,
binary 'FF' or spaces.
if the answer to that interrogation of the DB is true,
you can use the
x'000000000000000000000000000000' ,
x'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' ,
and ' ' literals in your case statement.

but, if there is a combination of low-values/high-values and spaces
you case statement will not hold true.

your example in the locked topic where you provide your own case solution shows that the resulting value to be 1 char *.
now, when you have an accurate and complete description of the possible values and the required results, reply and someone will provide you with a solution.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top