prasanth_bs
New User
Joined: 08 Aug 2005 Posts: 9
|
|
|
|
Hi
I having a file of 1ength 220 .My Input file is as like below
Code: |
field1 field2
123 657
123 456
321 234
321 435
143 222
567 888
|
And i want my output file as
Code: |
field1 field2
123 657
321 435
143 222
567 888
|
ie , first i want to sort field1 and if field1 has duplicates i want to elimate records based on the field 2 value ie, i want the record which has highest value in field2
can u suggest a way for doing this??? |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will 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(1,3,ZD) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,3,ZD,A,13,3,ZD,D)
/*
|
|
|