Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
k_kirru
Currently Banned

New User

Joined: 14 Sep 2005
Posts: 16

 Posted: Thu Nov 24, 2005 4:19 pm    Post subject: Can you explain how the SORT will do internally Hi, I am using the following sysntax to eliminate the duplicates. SORT FILEDS=(1,6,A),FORMAT=BI SORT FIELDS=NONE The I/P file is 111111 1 111112 1 111113 1 111114 1 111115 1 111111 2 111112 2 111113 2 111114 2 111115 2 111111 3 111112 3 111113 3 111114 3 111115 3 The O/P file i got is 111111 1 111112 2 111113 1 111114 2 111115 1 Here my problem is how the sort technique is doing internally because the customers 11111,111113 and 111115 have selected from first sequence and remaining two cusomers are selected from next seq. Really i couldnt understand how the SORT will do internally. Here my problem is i am having all the customers in one file for 12 months, so here some times customer no's are duplicate. so i need to select latest customer. Can anyone help out how to sort this prob. Thanks in advance. Regards, Kiran

Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Thu Nov 24, 2005 9:57 pm    Post subject:

When EQUALS is in effect with SUM FIELDS=NONE, DFSORT selects the first record of each set of duplicates. When EQUALS is not in effect with SUM FIELDS=NONE, DFSORT can select any record of each set of duplicates. So if you add:

 Code: OPTION EQUALS

you'll get the first record of each set of duplicates.

 Quote: so i need to select latest customer.

If by the "latest" customer, you mean the last record of each set of duplicates, you can use a DFSORT/ICETOOL job like this:

 Code: //S1    EXEC  PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD DSN=...  input file //OUT DD DSN=...  output file //TOOLIN DD * SELECT FROM(IN) TO(OUT) ON(1,6,BI) LAST /*

For your example, OUT will have:

 Code: 111111 3  111112 3  111113 3  111114 3  111115 3

If that's not what you want, then you need to explain clearly what you do want and show an example of the input records and what you want for output.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
k_kirru
Currently Banned

New User

Joined: 14 Sep 2005
Posts: 16

 Posted: Fri Nov 25, 2005 12:03 pm    Post subject: Re: Can you explain how the SORT will do internally Hi Frank Yaeger, Very much Thanks for your suggestion, my problem has got solved from your code . Once again thank you very much. Regards, kiran.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 3 Fri Mar 23, 2018 10:54 am How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm Can we merge these two sort cards int... abdulrafi JCL & VSAM 2 Thu Mar 08, 2018 4:03 pm SORT CARD ram_vizag DFSORT/ICETOOL 13 Thu Mar 01, 2018 4:55 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us