IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference in SORT & ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Fri Sep 22, 2017 4:56 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Sep 22, 2017 6:13 pm
Reply with quote

Look at the EQUALS parameter.
Back to top
View user's profile Send private message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 15
Location: INDIA

PostPosted: Fri Sep 22, 2017 6:57 pm
Reply with quote

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
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Sep 22, 2017 7:04 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 931
Location: Maryland

PostPosted: Fri Sep 22, 2017 8:04 pm
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Sun Sep 24, 2017 8:47 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 7
No new posts How can we simulate JOINKEYS in ICETOOL DFSORT/ICETOOL 9
No new posts Date conversion using SORT SYNCSORT 4
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts ICETOOL job to pull ML1 datasts DFSORT/ICETOOL 7
Search our Forums:

Back to Top