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
 

 

When to use COBOL Sort and when JCL Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: When to use COBOL Sort and when JCL Sort
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Re: When to use COBOL Sort and when JCL Sort
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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