View previous topic :: View next topic
|
Author |
Message |
Mohan Kothakota
New User
Joined: 12 Apr 2016 Posts: 15 Location: INDIA
|
|
|
|
Hi All,
I have two VSAM Files as Input, When I am trying to SORT with 'PGM=SORT' & 'PGM=ICETOOL', I am getting a mismatch for just two records.
Code: |
SORT Condition:
//SYSIN DD *
SORT FIELDS=(20,5,A,3,17,A),FORMAT=BI
RECORD TYPE=F,LENGTH=180
MODS E15=(VSAME15F,0,,N)
/* |
Records which are having issue after SORT
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
0B A2Y í Çí%
00 A2Y c° |
ICETOOL Condition:
Code: |
//TOOLIN DD *
COPY FROM(SORTIN) TO(TEMP) VSAMTYPE(F)
COPY FROM(E15IN1) TO(TEMP) VSAMTYPE(F)
SORT FROM(TEMP) TO(SORTOUT) USING(SRT1)
/*
//SRT1CNTL DD *
SORT FIELDS=(20,5,A,3,17,A),FORMAT=BI
RECORD TYPE=F,LENGTH=180
/* |
Records which are having the issue after ICETOOL
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
00 A2Y c°
0B A2Y í Çí%
|
When I verified the Input VSAM file records we are having records as below
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
00 A2Y c°
0B A2Y í Çí% |
Is there any reason why am I getting different results with SORT whereas ICETOOL results look more accurate as per Input.
Thanks,
Mohan Kothakota |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
Look at the EQUALS parameter. |
|
Back to top |
|
|
Mohan Kothakota
New User
Joined: 12 Apr 2016 Posts: 15 Location: INDIA
|
|
|
|
Sorry John, I didn't understand your answer. I am checking why SORT is giving different results when compared to ICETOOL even when we are using the same conditions. |
|
Back to top |
|
|
John Del
New User
Joined: 27 Apr 2012 Posts: 42 Location: NY
|
|
|
|
Mohan Kothakota wrote: |
Sorry John, I didn't understand your answer. I am checking why SORT is giving different results when compared to ICETOOL even when we are using the same conditions. |
Mohan -
Your example data indicates that there is no unique data for the keys that you are using to sort your data on.
If you want to preserve the original sequence of input to output when data has identical keys, then you will need to use the EQUALS parameter/option.
See the DFSORT manual....
www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.icea100/ice1ca6176.htm
/* |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
Mohan Kothakota wrote: |
Sorry John, I didn't understand your answer. I am checking why SORT is giving different results when compared to ICETOOL even when we are using the same conditions. |
When SORT operation is performed on the records with equal key fields the order of those records in the output dataset is not guaranteed unless option EQUALS is used in SORT statement.
Without EQUALS the sorting utilities are free to place the equal keys as it is more convenient to their own internal sorting method.
You're just getting what you requested by your control statements; neither more nor less.
BTW: if you tried to use SORT FIELDS=COPY the output order would not change. |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
What is the record format VB or FB ?
If it is VB and if you are copying it to a PS dataset, then you need to specify RECORD TYPE=V.
And records starts at position 5.
if it is a FB then try adding EQUALS
Code: |
SORT FIELDS=(20,5,A,3,17,A),FORMAT=BI,EQUALS
|
|
|
Back to top |
|
|
|