Write the sort logic in COBOL.
Write the sort logic in COBOL.
Hi,
I need to write a COBOL program to sort the file in ascending order without sort. As sort is not working in Micro Focus language. Can somebody please guide on this?
I need to write a COBOL program to sort the file in ascending order without sort. As sort is not working in Micro Focus language. Can somebody please guide on this?
Re: Write the sort logic in COBOL.
What do you mean by "not working"?
What environment are you running in?
If MF sort is not working have you contacted MF?
Which sort algorithm do you want?
What environment are you running in?
If MF sort is not working have you contacted MF?
Which sort algorithm do you want?
Regards
Nic
Nic
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Write the sort logic in COBOL.
Find the COBOL language reference for your Micro Focus product.
Read the language reference on the SORT verb.
COBOL has the SORT verb which allows sorting without needing anything else. You cannot do complicated SORT logic using JOINKEYS and so forth, but you can use an INPUT PROCEDURE or OUTPUT PROCEDURE to replace some of the SORT user exits available in the mainframe SORT package.
And if SORT is not working in Micro Focus, why are you not on the vendor site requesting assistance from them? If their SORT is not working, and you or your site have a license for the product, they should provide help (unless you are clearly violating one of their limitations).
Read the language reference on the SORT verb.
COBOL has the SORT verb which allows sorting without needing anything else. You cannot do complicated SORT logic using JOINKEYS and so forth, but you can use an INPUT PROCEDURE or OUTPUT PROCEDURE to replace some of the SORT user exits available in the mainframe SORT package.
And if SORT is not working in Micro Focus, why are you not on the vendor site requesting assistance from them? If their SORT is not working, and you or your site have a license for the product, they should provide help (unless you are clearly violating one of their limitations).
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Write the sort logic in COBOL.
I think he is trying to mimic bubble sort, insertion sort or other variants using COBOL without really calling SORT product at shop. Just a guess though.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: Write the sort logic in COBOL.
Yes, I need to replicate SORT logic just uisng COBOL and not by calling some external SORT utility.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Write the sort logic in COBOL.
You STILL have not explained what you need. Use the COBOL SORT verb -- see https://www.ibm.com/support/knowledgece ... y5lr10.pdf for details. That uses nothing but COBOL -- no external SORT utility required. If you want to implement a sort algorithm in COBOL, that is a very different matter, and the first question would be WHY NOT USE THE SORT VERB?Yes, I need to replicate SORT logic just uisng COBOL and not by calling some external SORT utility.
Re: Write the sort logic in COBOL.
I will have a file like this:
0010
0009
0003
0008
0007
0005
0002
0001
0006
0004
and I want to sort them in ascending order. I can do it using by calling the SORT but I need to use using a COBOL program logic.
0010
0009
0003
0008
0007
0005
0002
0001
0006
0004
and I want to sort them in ascending order. I can do it using by calling the SORT but I need to use using a COBOL program logic.
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Write the sort logic in COBOL.
Google is your friend. Googling sort algorithms returned about 563,000 results and several on the first page give you algorithms to code up. Please note that this is a HELP forum, not a WRITE-THE-CODE-FOR-YOU forum. If you want somebody to write the code for you, plan on paying for that person's expertise.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute