|
|
| Author |
Message |
k_kirru Currently Banned New User
Joined: 14 Sep 2005 Posts: 16
|
|
|
|
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 |
|
| Back to top |
|
 |
References
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4621 Location: San Jose, CA
|
|
|
|
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:
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 |
|
| Back to top |
|
 |
k_kirru Currently Banned New User
Joined: 14 Sep 2005 Posts: 16
|
|
|
|
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. |
|
| Back to top |
|
 |
|
|
|