Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us