View previous topic :: View next topic
|
Author |
Message |
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi All,
I am having a COBOL table and I want to use SORT command on it. That's mean I want to use an internal sort for this COBOL table. Is it possible?
For example :
Code: |
01 WS-TABLE.
05 WS-TBL OCCURS 10 TIMES.
10 NAME PIC x(20).
10 AGE PIC 9(02).
|
Now I want to sort it using the SORT command. Can u pls help me out by sending some code-example?
Please help me out. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
There is no SORT command as such to sort a table.
SORT verb in COBOL supports sorting in a file.
For sorting a table you can see sample programs section on this site.
Good luck. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Yes, you can sort a internal table, but you will still need to define an SD.
Just release your table entries to the sort in the input procedure and recieve them back in the output procedure. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
That's incredible! I will try this and tell you about it. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Thanks William! I have got the answer and I have tested it out. Its working. Thanks a lot once again to all of u. |
|
Back to top |
|
|
|