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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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