Hi,
In COBOL is there a compiler option within the internal program sort to the entire file first and then sort by the key supplied?
Or is there an option to do the same at programming level
Thanks in advance
COBOL SORT - How to sort entire file first & sort by Key
- prino
- Posts: 641
- Joined: Wed Mar 11, 2009 12:22 am
- Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
- Referer: Google
- Location: Vilnius, Lithuania
- Contact:
Re: COBOL SORT - How to sort entire file first & sort by Key
And the advantage of doing this is?
Clueless in Calcutta, I guess...
Clueless in Calcutta, I guess...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
robert.ah.prins @ the.17+Gb.Google thingy
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: COBOL SORT - How to sort entire file first & sort by Key
k_ekam wrote:Hi,
In COBOL is there a compiler option within the internal program sort to the entire file first and then sort by the key supplied?
Or is there an option to do the same at programming level
Thanks in advance
In the latest version of COBOL, there is a new option:
PARM='DOMYJOBFORMEINFULL'
Try to specify it, and you'll get everything you want.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: COBOL SORT - How to sort entire file first & sort by Key
If you look in the Language Reference manual for your version of COBOL, you will discover that the syntax for the SORT verb requires a key be specified. Hence, unless you define a key for the entire record and sort on that key, you cannot "sort the entire file".
Furthermore, wanting to sort the entire file followed by a key sort makes no sense. The sort of the entire file will be negated by the key sort since the end result will be the file will be in key sequence.
Furthermore, wanting to sort the entire file followed by a key sort makes no sense. The sort of the entire file will be negated by the key sort since the end result will be the file will be in key sequence.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2
- 1439
-
by naga821
View the latest post
Fri Oct 28, 2022 7:31 pm
-
-
Split file, SORT then append records.
by Esmayeelhusen » Fri Aug 04, 2023 6:37 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 5154
-
by Esmayeelhusen
View the latest post
Wed Aug 09, 2023 7:39 am
-
-
- 2
- 1443
-
by willy jensen
View the latest post
Fri Aug 13, 2021 8:11 pm
-
- 1
- 1766
-
by prino
View the latest post
Tue Jul 02, 2024 2:23 pm
-
-
How to sum a decimal value using sort
by hkaur7087 » Thu Aug 05, 2021 2:19 pm » in DFSORT/ICETOOL/ICEGENER - 4
- 2346
-
by sergeyken
View the latest post
Thu Aug 05, 2021 7:48 pm
-