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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 4 Wed Jul 26, 2017 7:35 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


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