View previous topic :: View next topic
|
Author |
Message |
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Hi all,
I got this requirement to SORT the data available in TSQ on a certain field. Is there any way to directly SORT TSQ than applying logical sorting on it..
Thanks in advance... |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
you can't sort in CICS
consider 3rd part product batchcics-connect (www.batchcics.com),
With batchcics-connect , you could write a BATCH cobol
program that
1 reads the tsq and uses standard Batch COBOL SORT verb to sort it
2 delete the old tsq
3 write the returned sort record to a new tsq
then the new "sorted" tsq would be available for access by other CICS programs
|
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Thanks for the quicky..
But I want to do it from my progm .. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
There used to be third party products (hyper-sort) that you could call from your cics program (like the batch cobol sort) except that you do not use select and file clauses in cics.
another way is to do an internal cobol table bubble sort.
and i would build the cobol table with 1) the sort field(s) and 2) the que item number.
then you would only need to provide the que item number list (sorted on the sort field(s)). Deleting the que and then rewriting is an unnecessary overhead. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
to each his own.
cobol table sorts are great, when the number of table items are
small and you don't blow past the table occurs size. AND other
cics programs don't need to access the table.
processing a large table can sometimes degrad response time
for other cics applications, and I've seen AICA abends occur.
You might also consider witing the tsq items to a vsam keyed' file,
which would then be available to other CICS programs.
|
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
1. Load the contents of the TS queue into a working storage table.
2. Sort the table.
3. Delete the TS Queue and recreate it using the sorted table.
I posted copybooks that sort a COBOL table. Do a search on "Sort Copybooks" and specify "TG Murphy" as the author for details. The sort is a heapsort - very efficient - and can be used in CICS.
Warning - these copybooks are new and nobody has tested them out besides myself. |
|
Back to top |
|
|
|