View previous topic :: View next topic
|
Author |
Message |
sankarcpp1
New User
Joined: 30 Oct 2005 Posts: 5 Location: India
|
|
|
|
Hi,
I am using the below control card to SORT a input file(LREC=35 and number of records approximately 38000) based on the first 8 ch(account number).
SORT FIELDS=(1,8,CH,A)
OMIT COND=((1,4,CH,EQ,C'UHDR') or 1,4,CH,EQ,C'UTRL')
When I ran the job in production (uses DFSORT V1R5) and test(V1R10) region output files are not sync. I could find mismatches(SORTING ORDER) in the sorted output file between production and test regions.
Is there any reason behind why this mismatches(SORTING ORDER) in the output file?
Sankar. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are the 'mismatches' equal keys?
I only know that the EQUALS option will maintain the sequence of equal keys.
possibly installation parms (default parms) are different. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
may be your input files itself not same??? |
|
Back to top |
|
|
sankarcpp1
New User
Joined: 30 Oct 2005 Posts: 5 Location: India
|
|
|
|
Input Files are same in production and test regions.
Also number of records in sorted output files too same but the sorted order is different in both the files. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Sankar,
Welcome to the forums.
I dont think this is due to your version problem. The order of equally keyed records can be different unless you specify the 'EQUALS' parameter which retains the order of records as it appears in the input file.
DFSORT Application Programming Guide wrote: |
EQUALS
specifies that the original sequence must be preserved.
NOEQUALS (Default)
specifies that the original sequence need not be preserved. |
|
|
Back to top |
|
|
sankarcpp1
New User
Joined: 30 Oct 2005 Posts: 5 Location: India
|
|
|
|
Thanks.
Since the SORT control card is same in both the regions then why it is behaving in two different ways(two different output files).Anyway I am not mentioning the EQUALS options either in production (V1R5) and test (V1R10) regions.
As Dick Brenholtz said mismatches is only with the equal keys. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Since the SORT control card is same in both the regions then why it is behaving in two different ways(two different output files).Anyway I am not mentioning the EQUALS options either in production (V1R5) and test (V1R10) regions.
|
without the EQUALS option, the order of equal keys is unpredictable.
use the EQUALS option in both test and production to obtain equal results. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sankarcpp1,
As mentioned earlier OPTION EQUALS is what caused the difference in SORTING order. OPTION EQUALS specifies whether the original sequence of records that collate identically for a sort or a merge should be preserved from input to output.
As a simple example:
Code: |
AAAA R1
AAAA R2
AAAA R3
|
If we sort these three records on positions 1-4 with EQUALS with DFSORT,the output is guaranteed to be:
Code: |
AAAA R1
AAAA R2
AAAA R3
|
because EQUALS says to keep records with the same key (duplicate records) in their original order.
However, if we sort these three records on positions 1-4 with NOEQUALS with DFSORT the output can have those records in any order, e.g.
Code: |
AAAA R2
AAAA R3
AAAA R1
|
or
Code: |
AAAA R3
AAAA R1
AAAA R2
|
because NOEQUALS says that records with the same key can be in any order.
Run this step which will list all your site defaults and look for equals
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//OUT DD SYSOUT=*
//TOOLIN DD *
DEFAULTS LIST(OUT)
/*
|
|
|
Back to top |
|
|
|