View previous topic :: View next topic
|
Author |
Message |
Amit Kumar Warnings : 1 New User
Joined: 27 Mar 2007 Posts: 3 Location: chennai
|
|
|
|
Hi All,
i m using dfsort to sort the input file. In the input some records having same value in sort fields. Can u tell me in which order these records will come in output file is there any way so i can change the order of records.
Amit |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Amit,
You must be specifying a SORT FIELDS stetement in the JCL SORT step.
The SORT FIELDS can contain 1 or more fields for sorting.
Say SORT FIELDS=(1,9,CH,A,83,9,CH,A)
It will sort using first 9 bytes, then using 9 bytes from 83rd byte.
Hope this helps you.
Thanks, |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Amit Kumar wrote: |
In the input some records having same value in sort fields. Can u tell me in which order these records will come in output file |
If you do not specify that you want equal keys kept in their current sequence, the order they output is unpredictable.
Quote: |
is there any way so i can change the order of records. |
The only way to change their order is by adding an additional key to the sort. |
|
Back to top |
|
|
Amit Kumar Warnings : 1 New User
Joined: 27 Mar 2007 Posts: 3 Location: chennai
|
|
|
|
Hi all,
I came accross a easytrieve program that is sorting a input file , i m trying to simulate the same by using jcl or cobol.
So far i used only dfsort but the output by easytrieve and dfsort is not matching.
The order of records in output fie is not matching for those records which all having same value in sort fields.
I come to know that internally easytrieve is also calling dfsort may be with different options.
If u have any suggestion. reply me back !
Amit |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Does the easytrieve job print out the sort statemnts that it uses ? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Amit Kumar wrote: |
I came accross a easytrieve program that is sorting a input file , i m trying to simulate the same by using jcl or cobol.
So far i used only dfsort but the output by easytrieve and dfsort is not matching.
The order of records in output fie is not matching for those records which all having same value in sort fields.
I come to know that internally easytrieve is also calling dfsort may be with different options. |
What is the order in the output file for the equals? The same as the input file?
What in the EZT program gives you the idea that sort is being called? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
For DFSORT, the EQUALS or NOEQUALS option determines the order of duplicate records. With EQUALS in effect, the duplicate records appear in the output in the same order they appear in the input. With NOEQUALS in effect, the duplicate records can appear in any order. If you have EQUALS in effect for DFSORT and easytrieve, then the order of the duplicate records will match. Otherwise, they won't necessarily match.
DFSORT message ICE128I shows EQUALS=Y for EQUALS or EQUALS=N for NOEQUALS. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|