ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportSorting data in Descending and Ascending order

Post new topicReply to topic
Sorting data in Descending and Ascending order View previous topic :: View next topic
Author Message
Android 23
PostPosted: Thu Oct 26, 2017 11:52 pm Post subject: Sorting data in Descending and Ascending order Reply with quote

Apprentice

Joined: 27 Mar 2017
Posts: 37

Hi guys,

I have doubt in sorting data in descending & ascending order in iib.

Whereas, We can sort this in java through code. Does IIB can do that using codingg..

We dnt retreieve data from database.

Input data:

Quote:

<students>
<std1>
<DOB>01-10-1994</DOB>
</std1>
<std2>
<DOB>10-10-1994</DOB>
</std2>
<std3>
<DOB>01-01-1990</DOB>
</std3>
<std4>
<DOB>08-10-1985</DOB>
</std4>
</students>


We get input data & generate data in desc & asce order.

Thanks & Regards.
Android 23.
Back to top
View user's profile Send private message
sudheer7700
PostPosted: Fri Oct 27, 2017 1:12 am Post subject: Reply with quote

Novice

Joined: 01 Feb 2017
Posts: 17

There is no function available for Sorting data in ESQL . 2 possible ways

In ESQL while loop and compare every data in xml tags and shuffle as per sorting order.

Calling external java, TreeSet with Comparator program.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 27, 2017 4:50 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24614
Location: Ohio, USA

Someone wrote a sort in ESQL and posted it to this forum a few years back. The search facility could probably turn it up for you.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Oct 27, 2017 4:53 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5563
Location: UK

sudheer7700 wrote:

In ESQL while loop and compare every data in xml tags and shuffle as per sorting order..


Don't use Bubble Sort, Quick Sort is simple to implement and much faster.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Oct 27, 2017 4:58 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24614
Location: Ohio, USA

zpat wrote:
Quick Sort is simple to implement and much faster.




Isn't that what that guy did?

I wish I was motivated enough to look it up.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Oct 27, 2017 5:10 am Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5563
Location: UK

http://www.mqseries.net/phpBB2/viewtopic.php?p=273722&highlight=#273722

Yes, this is quicksort in ESQL.

I am sure I coded it in REXX once with many fewer lines ...
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportSorting data in Descending and Ascending order
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.