Ron, You can use the following DFSORT/ICETOOL JCL which will give you the desired results. I assumed that your input is FB recfm and LRECL=80. I also assumed that the customer number is a max of 10 bytes and starts at position 12 in your input file and timestamp starts in position 35.
//STEP0100 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * ----+----1----+----2----+----3----+----4----+----5----+----6- 100000001 496120145 2011-11-17-16.16.37.192280 100000002 496120145 2012-08-13-23.29.58.889499 100000003 315307220 2012-08-13-23.37.11.974326 100000003 0315307220 2012-06-13-23.37.11.974326 100000004 465464516 2012-08-13-23.56.32.610649 //OUT1 DD SYSOUT=* //OUT2 DD SYSOUT=* //TOOLIN DD * SELECT FROM(IN) TO(OUT1) ON(81,10,CH) FIRST - DISCARD(OUT2) USING(CTL1) //* //CTL1CNTL DD * INREC OVERLAY=(81:12,10,UFF,M11,LENGTH=10) SORT FIELDS=(81,10,CH,A,35,26,CH,D) OUTFIL FNAMES=OUT1,BUILD=(1,80) OUTFIL FNAMES=OUT2,BUILD=(1,80) //* OUT1 will have the following 100000003 315307220 2012-08-13-23.37.11.974326 100000004 465464516 2012-08-13-23.56.32.610649 100000002 496120145 2012-08-13-23.29.58.889499 OUT2 will have the following 100000003 0315307220 2012-06-13-23.37.11.974326 100000001 496120145 2011-11-17-16.16.37.192280 Further if you have any questions please let me know Kolusu DFSORT Development IBM Corporation IBM Mainframe Discussion List <[email protected]> wrote on 09/26/2012 12:19:14 AM: > From: Ron Thomas <[email protected]> > To: [email protected], > Date: 09/26/2012 12:19 AM > Subject: Re: DFSORT > Sent by: IBM Mainframe Discussion List <[email protected]> > > Forgot to point one another thing here, so i am updating my post > > > In the below file , i need the o/p is as follows. The 2'nd cloumn is > the Custno and is having duplicates > I need to pick only the latest one and the other to be moved to a > seperate file. Could some one share your thoughts? > > > one more thing here is the custno "315307220" & '0315307220" can > come in the file and this is duplicate one > > Input > > 100000001 496120145 2011-11-17-16.16.37.192280 > 100000002 496120145 2012-08-13-23.29.58.889499 > 100000003 315307220 2012-08-13-23.37.11.974326 > 100000003 0315307220 2012-06-13-23.37.11.974326 > 100000004 465464516 2012-08-13-23.56.32.610649 > > Output1 > > 100000002 496120145 2012-08-13-23.29.58.889499 > 100000003 315307220 2012-08-13-23.37.11.974326 > 100000004 465464516 2012-08-13-23.56.32.610649 > > Output2 > > 100000001 496120145 2011-11-17-16.16.37.192280 > 100000003 0315307220 2012-06-13-23.37.11.974326 > > > > Regards > Ron T > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
