MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

keep last record in sort sequence ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Wed Apr 15, 2009 10:12 am    Post subject: keep last record in sort sequence ? Reply with quote

Is there a way to sort a file and only keep the last record in the sort sequence ?

Here's an example :

I only want to keep the records indicated by the arrows

Code:
BOSTON     20080415
BOSTON     20080415
BOSTON     20080415  <---
BOSTON     20091020
BOSTON     20091020 
BOSTON     20091020  <---
WORCESTER  20080501 
WORCESTER  20080501
WORCESTER  20080501
WORCESTER  20080501  <---
WORCESTER  20090515
WORCESTER  20090515
WORCESTER  20090515  <---


Thanks for any help.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Apr 15, 2009 10:28 am    Post subject: Reply with quote

tcurrier,

You can use DFSORT/ICETOOL's SELECT with LAST parm. Check this
Code:

//STEP0100 EXEC PGM=ICETOOL                           
//TOOLMSG  DD SYSOUT=*                                 
//DFSMSG   DD SYSOUT=*                                 
//IN       DD *                                       
BOSTON     20080415                                   
BOSTON     20080415                                   
BOSTON     20080415  <---                             
BOSTON     20091020                                   
BOSTON     20091020                                   
BOSTON     20091020  <---                             
WORCESTER  20080501                                   
WORCESTER  20080501                                   
WORCESTER  20080501                                   
WORCESTER  20080501  <---                             
WORCESTER  20090515                                   
WORCESTER  20090515                                   
WORCESTER  20090515  <---                             
//OUT      DD SYSOUT=*                                 
//TOOLIN   DD *                                       
  SELECT FROM(IN) TO(OUT) ON(1,10,CH) ON(12,8,CH) LAST
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group