Why do we use multiple fields in SORT FIELDS?



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Why do we use multiple fields in SORT FIELDS?

Postby ranga_subham » Thu Nov 13, 2008 4:22 pm

Hi,

I am not able to understand this basic concept somehow ! Please help.

Below job produces same output for both steps. So, what is the use of mentioning multiple fields in SORT FIELDS?

//STEP0001 EXEC PGM=SORT                 
//SORTIN   DD *                           
KRITCHA 01 070175                         
ROSANAR 02 061585                         
MOHANRU 05 121288                         
VISHHNU 04 010175                         
ARINDAM 03 110772                         
//SYSOUT   DD SYSOUT=*                   
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                           
 SORT FIELDS=(1,7,CH,A,9,2,CH,A,12,6,CH,A)
/*                                       
//*                                       
//STEP0002 EXEC PGM=SORT                 
//SORTIN   DD *                           
KRITCHA 01 070175                         
ROSANAR 02 061585                         
MOHANRU 05 121288                         
VISHHNU 04 010175                         
ARINDAM 03 110772               
//SYSOUT   DD SYSOUT=*           
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                 
 SORT FIELDS=(1,7,CH,A,12,6,CH,A)
/*                               


Output from STEP0001:
ARINDAM 03 110772
KRITCHA 01 070175
MOHANRU 05 121288
ROSANAR 02 061585
VISHHNU 04 010175


Output from STEP0002:
ARINDAM 03 110772
KRITCHA 01 070175
MOHANRU 05 121288
ROSANAR 02 061585
VISHHNU 04 010175


Would you please help me understanding this concept?

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Why do we use multiple fields in SORT FIELDS?

 

Re: Why do we use multiple fields in SORT FIELDS?

Postby Bill Dennis » Thu Nov 13, 2008 7:37 pm

The purpose of multiple sort fileds is to properly sequence multiple records with the same primary key ( 1-7 ). If ARINDAM had three records with unique values in columns 9 and 10 the results would be different.

Your sample is so small you don't see the effect.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post