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

When to use COBOL Sort and when JCL Sort


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthikuma

New User


Joined: 29 Mar 2005
Posts: 62

PostPosted: Wed Apr 06, 2005 12:35 pm
Reply with quote

In company which sort is using(cobol r jcl ). at wat condition we have to go for cobol and for jcl.

bye,
kumar
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Wed Apr 06, 2005 5:21 pm
Reply with quote

jcl sorting's performance is generally more better than cobol sorting. as in case of cobol sorting the resource are held up till the whole program didn't get executed where as in case of jcl sorting the resources are released as soon as just sorting is over. e.g.
there are 2 programs PROG1 and PROG2.Output of PROG1 need to be accesed in sorted format in PROG2. Now if you perform cobol sorting then the resource for sorting i.e. ur intermidiate work file will be held up unless and untill PROG2 completes it's execution where as if you use jcl sorting then PROG1-SORT-PROG2. Now sort utility will give the sorted output to the PROG2 and it can perform directly the input(sorted output of PROG1).
The intermidiate work file all will be relesed as soon as execution of SORT utility is over.
and at the same time running the utility programs take the minimum time and it's space complexity as well as time complexity is better than a normal program.
One can go for cobol sorting only when the execution time for the PROG2 is not very high.But if the execution time of PROG2 is very high then i think it is better to go for JCL sorting.
Back to top
View user's profile Send private message
squid_rocks

New User


Joined: 21 Mar 2005
Posts: 15
Location: Pune, INDIA

PostPosted: Wed Apr 27, 2005 1:08 pm
Reply with quote

Hi,
I would like to add something here...
In either of the sort methods, internally a JCL is submitted (what I mean here is, even if you do an internal sort, a JCL is actually submitted). So actually there is not much difference.
But the catch is here...
Internal sort (COBOL sort) we use when:-
1. We have less data to sort.
2. when we need to use INPUT PROCEDURE and OUTPUT PROCEDURE.

Whereas external sort is preferred when we have huge records in the file to sort.

One more thing is (not sure about this one) - We do not have to declare the files that we need to sort externally, in the COBOL program as is the case with SD entry for internal-sort file.

Hope this is of some help...
Pls correct me if wrong
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon May 02, 2005 7:00 am
Reply with quote

Generally external (JCL) sorts perform I/O operations far more efficiently than internal sorts using I/O PROCEDURES.

If an internal sort doesn't use I/O PROCEDURES (and I think the Compiler Option FASTSRT is also required) it performs as efficiently as an external sort.

So it's adviseable to use external sorts if at all possible. I know some shops require all sorts to be external, in spite of passing the data more than once. Would I go that far? Not without some test verification.
Back to top
View user's profile Send private message
rushtojayaraj

New User


Joined: 15 Jul 2005
Posts: 2

PostPosted: Mon Aug 14, 2006 5:46 pm
Reply with quote

Hi,

I completely agree with the above points
Let me add few more things...

when we have to make a decision between JCL or Cobol sort consider the following factors.

1.Size of the data that needs to be sorted
2.Perfomance
3.Reusability(the temp output file in JCL sort can be passed on to next step)
4.purpose of the sort -Sorting in order of one or more fields either in ascending or descending order, Elimination of duplicates,include or exclude records based on the given condition and a lot more..


regards,
Jai
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 -> COBOL Programming

 


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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top