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
 
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: 1281
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 Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm

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