View previous topic :: View next topic
|
Author |
Message |
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
We are weeding out the differences from a file on the basis of a field A.
Is there any way we can retain the last occurence of a particular value of the field A and discard the duplicates? What I mean is :
Code: |
Record number Field A Rest of record
1 AAA 12345
5 AAA 11111
10 AAA 22222
|
We need to keep the last record i.e record number 10 in our output and remove the other two!!
Any suggestions?????????????????????????????????????? |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
I am sorry: I meant we are weeding out duplicates from the record...(and not differences as in my prev post!!) |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following to do what you asked for:
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(19,7,CH) LAST
/*
|
|
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Cooolllllll ..... Lemme try it out .. I will get back if I need anything else!!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Ok. 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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|