Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Difference in SORT & ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Mohan Kothakota

New User


Joined: 12 Apr 2016
Posts: 12
Location: INDIA

PostPosted: Fri Sep 22, 2017 4:56 pm    Post subject: Difference in SORT & ICETOOL
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: 27
Location: NY

PostPosted: Fri Sep 22, 2017 6:13 pm    Post subject:
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: 12
Location: INDIA

PostPosted: Fri Sep 22, 2017 6:57 pm    Post subject: Reply to: Difference in SORT & ICETOOL
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: 27
Location: NY

PostPosted: Fri Sep 22, 2017 7:04 pm    Post subject: Re: Reply to: Difference in SORT & ICETOOL
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....
https://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 User


Joined: 29 Apr 2008
Posts: 189
Location: Maryland

PostPosted: Fri Sep 22, 2017 8:04 pm    Post subject: Re: Reply to: Difference in SORT & ICETOOL
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: 210
Location: Chennai

PostPosted: Sun Sep 24, 2017 8:47 am    Post subject: Reply to: Difference in SORT & ICETOOL
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us