Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Select most recent date (MMDDYY) record using syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
jaganmoni1

New User


Joined: 31 Oct 2008
Posts: 33
Location: CANADA

PostPosted: Wed Nov 30, 2011 7:11 am    Post subject: Select most recent date (MMDDYY) record using syncsort
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: 1703
Location: Australia

PostPosted: Wed Nov 30, 2011 8:03 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us