Posted: Wed Oct 31, 2007 11:47 am Post subject: SORT and PICK ONLY First Record
Input File:
Code:
----+----1----+----2----+----3----+----4-
********************************* Top of
0015007510300000621012000-09-262000-10-18
0015007510300000621012000-10-189999-12-31
0015007510300000629732000-09-269999-12-31
0015007510300001301012001-10-022001-10-25
0015007510300001301012001-10-259999-12-31
0015007510300001309732001-10-029999-12-31
- Need to SORT Descending on Positions 1-18, 22-31,32-41
- Then check for the recent date and produce 1 row for every identical numbers in between 1 and 18 positions
For E.G., there are 3 rows with 001500751030000062 in the input file, in the output file I need to write ONLY 1 row that have the date of 2000-10-189999-12-31
Based on the E.G., this is how the output is expected
Code:
----+----1----+----2----+----3----+----4-
********************************* Top of
0015007510300000621012000-10-189999-12-31
0015007510300001301012001-10-259999-12-31
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Oct 31, 2007 12:56 pm Post subject:
Quote:
My Assumption is there should be something like FIRST instead of NODUPS or ALLDUPS to use, But I am NOT SURE !
Yes, FIRST is an operator of SELECT. Why didn't you just try using FIRST given that you thought it might be available?
Quote:
I am using ICETOOL
If you're using DFSORT, then you're using DFSORT's ICETOOL (ICE messages). If you're using Syncsort, then you're using Syncsort's SYNCTOOL (SYT messages). Are you using DFSORT or Syncsort?
Quote:
In the input file, I should exclude the First and Last rows from the SORT, they are the header and trailer.
If you can identify the header and trailer in some way, you can just use an OMIT statement to exclude them. SKIPREC=1 can also be used to exclude the first record. Excluding the last record is tricker if you can't identify it in some way. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum