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
 

 

HOw to directly SORT TSQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: HOw to directly SORT TSQ
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    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Fri Jan 11, 2008 7:11 pm    Post subject:
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    Post subject:
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: 149
Location: Ottawa Canada

PostPosted: Mon Jan 14, 2008 10:53 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 2 Sat Aug 19, 2017 2:33 pm
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm


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