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

how to find Low Values in DB2 Coloumn


IBM Mainframe Forums -> DB2
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
SriRanjan
Currently Banned

New User


Joined: 05 Sep 2006
Posts: 3

PostPosted: Tue Oct 10, 2006 10:50 am
Reply with quote

Hi All,

I have a column called 'Client_Name' with Char(50) in the DB2 table.
But this coloumn contains Low Values .So I want to find all the rows which contains Low Values in this column ... can u please help me out ???
Please find the attachment If u want example.
[/img]
Back to top
View user's profile Send private message
meetreks

New User


Joined: 28 Sep 2006
Posts: 26
Location: Edinburgh

PostPosted: Tue Oct 10, 2006 3:47 pm
Reply with quote

Just check Client_Name = X'0000', either in SPUFI or in the Host Program.

Hope this helps.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Oct 10, 2006 4:23 pm
Reply with quote

chk this out ...

SELECT Client_name FROM TABLE
WHERE LENGTH (Client_name) > LENGTH (REPLACE(Client_name, X?00?,'') ;
Back to top
View user's profile Send private message
SriRanjan
Currently Banned

New User


Joined: 05 Sep 2006
Posts: 3

PostPosted: Wed Oct 11, 2006 12:19 pm
Reply with quote

Thanks Guys for quick reply ...
tried both possible ways but Its not working.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 11, 2006 5:17 pm
Reply with quote

Hi sri ranjan,

Try for this what meetreks mentioned. This is working for me.

Select client_name from table name
where cline_name = x'00'
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Wed Oct 11, 2006 5:23 pm
Reply with quote

Hi sriranjan,

Sorry, my field is of x(1) that is why it was working.
If you give x'00' for x(50) time then your query will work.
I am not sure there is a shortcut.
Back to top
View user's profile Send private message
norm.flynn

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Wed May 08, 2013 1:57 am
Reply with quote

Here is a method which will work for looking for low values

select client_name from table
where client_name like X'6C006C'

The 6C is the hex equivalent of the '%' sign, This will return any rows with low values anywhere in the column
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 08, 2013 2:40 am
Reply with quote

I doubt that after 7 ( seven ) years SriRanjan might still be interested in the answer icon_cool.gif
Back to top
View user's profile Send private message
norm.flynn

New User


Joined: 08 Jan 2013
Posts: 20
Location: usa

PostPosted: Wed May 08, 2013 2:46 am
Reply with quote

had someone ask me about this, saw this post on the forum, so just wanted to post the solution to this issue as it is not well documented anywhere.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Mon Oct 31, 2016 11:43 pm
Reply with quote

And this solution did help me after 3 years icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. 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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
Search our Forums:

Back to Top