On Wed, 26 Sep 2012 02:19:14 -0500, Ron Thomas wrote:

>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
>
>


//*                                                            
//STEP1   EXEC PGM=ICETOOL                                     
//*                                                            
//TOOLMSG   DD SYSOUT=*                                        
//DFSMSG    DD SYSOUT=*                                        
//TMP1      DD SPACE=(TRK,(5,5))                               
//TMP2      DD SPACE=(TRK,(5,5))                               
//TMP3      DD SPACE=(TRK,(5,5))                               
//IN        DD *                                               
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=*                                        
//SRT1CNTL  DD *                                               
  SORT FIELDS=(12,10,UFF,A,35,26,CH,A)                         
/*                                                             
//SRT2CNTL  DD *                                               
  SORT FIELDS=(1,9,CH,A)                                       
/*                                                             
//TOOLIN    DD *                                               
  SORT   FROM(IN)               -                              
         TO(TMP1)               -                              
         USING(SRT1)                                           
  SELECT FROM(TMP1)             -                              
         TO(TMP2) DISCARD(TMP3) -                              
         ON(12,10,UFF)          -                              
         LAST                                                  
  SORT   FROM(TMP2)             -                              
         TO(OUT1)               -                              
         USING(SRT2)                                           
  SORT   FROM(TMP3)             -                              
         TO(OUT2)               -                              
         USING(SRT2)                                           
/*                                                             


Norbert Friemel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to