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
 

 

Order By CHAR fields in DB2

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

New User


Joined: 24 Nov 2007
Posts: 12
Location: chennai

PostPosted: Thu Jul 01, 2010 5:52 pm    Post subject: Order By CHAR fields in DB2
Reply with quote

Hi,

We have a requirement where we need to order by on a char field in such a way that we will get all the char fields which has numeric values and then we should get char fields containing other than numeric values.


For e.g.:

Table column has following values:
AAAA
BBBB
1009
100A
1010
101B
2000
3010

req o/p:

1009
1010
2000
3010
100A
101B
AAAA
BBBB

Please let us know how we can achieve the above results.

Thanks
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Thu Jul 01, 2010 6:18 pm    Post subject:
Reply with quote

in Unicode you already get 0..9 A..Z
in Ebcdic you get A..Z0..9
so you can experiment to get your data in the correct CCSID

or use collation_key()
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 Jul 01, 2010 8:04 pm    Post subject:
Reply with quote

Hello,

Depending on your overall requirement (not just this one sequence), suggest you convince "them" that on the mainframe, the sequence is not the same as on the pc.

Even when this process "works" there will very likely be problems when the data is used in other mainframe processes. The A will compare less than the zero in all of the program code. . .
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 Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Need Help to Define 36 Input Fields (... satish.ms10 CLIST & REXX 2 Sat May 07, 2016 3:08 pm


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