IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Select most recent date (MMDDYY) record using syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 35
Location: CANADA

PostPosted: Wed Nov 30, 2011 7:11 am
Reply with quote

Hi,

I have a VB file with LREC=2200. I have to eliminate the duplicate records by selecting the most recent date which is in MMDDYY format.
Sample Input Data:
800021234567300090211
800021234567300092311
800021234567300082411
181921234567300072411
181921234567300082411

In the above data the key value is in columns from 1 to 15 and the date value starts from 16 to 21

Expected Output Data:
181921234567300082411
800021234567300092311
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Nov 30, 2011 8:03 am
Reply with quote

Hi,

here is an example using an FB file, you just need to add 4 bytes to start positions for VB file
Code:
//STEP001  EXEC PGM=SYNCTOOL                                         
//IN1      DD *                                                     
800021234567300090211                                               
800021234567300092311                                               
800021234567300082411                                               
181921234567300072411                                               
181921234567300082411                                               
//LAST     DD SYSOUT=*                                               
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  SELECT FROM(IN1) TO(LAST) ON(1,15,CH)  -                           
  LAST USING(CTL1)                                                   
//CTL1CNTL DD *                                                     
  SORT FIELDS=(1,15,BI,A,20,2,BI,A,16,2,BI,A,18,2,BI,A)             
/*


Gerry
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top