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

HOw to directly SORT TSQ


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Fri Jan 11, 2008 3:44 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Jan 11, 2008 6:45 pm
Reply with quote

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


icon_cool.gif
Back to top
View user's profile Send private message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Fri Jan 11, 2008 7:04 pm
Reply with quote

Thanks for the quicky..

But I want to do it from my progm ..
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 11, 2008 7:11 pm
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Jan 11, 2008 10:34 pm
Reply with quote

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.

icon_lol.gif
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Mon Jan 14, 2008 10:53 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top