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
 

 

Want to remove some unwanted records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vishal_arora

New User


Joined: 20 May 2005
Posts: 16

PostPosted: Tue May 05, 2009 4:01 pm    Post subject: Want to remove some unwanted records
Reply with quote

Hi all

I have a input file with records like

Code:

975,       97515384,12/27/2006,12/27/2006, 000026373.00
975,       97515384,12/27/2006,02/10/2009, 000026373.00
975,       97515384,12/26/2007,12/26/2007, 000026373.00
975,       97515384,12/26/2007,02/10/2009, 000026373.00
975,       97515384,12/22/2008,12/22/2008, 000026373.00
975,       97515384,12/22/2008,02/10/2009, 000026373.00
975,       97515384,11/28/2008,11/28/2008, 000052746.00
975,       97515384,11/28/2008,02/10/2009, 000079119.00
975,       97515384,11/27/2006,02/10/2009, 000026373.00
975,       97515384,11/26/2007,11/26/2007, 000026373.00
975,       97515384,11/26/2007,02/10/2009, 000079119.00
975,       97515384,10/23/2006,02/10/2009, 000026373.00
975,       97515384,10/22/2007,02/10/2009, 000026373.00
975,       97515384,10/20/2008,10/20/2008, 000052746.00
975,       97515384,10/20/2008,02/10/2009, 000026373.00
975,       97515384,09/25/2008,09/25/2008, 000026373.00
975,       97515384,09/25/2008,02/10/2009, 000079119.00


Want to remove the all the records other than 02/10/2009 in third row using sort.

pls help
Back to top
View user's profile Send private message

maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Tue May 05, 2009 4:15 pm    Post subject:
Reply with quote

You can use Include condition with sort.

Code:
//SORT1    EXEC PGM=SORT                               
//SYSPRINT   DD SYSOUT=*                               
//SORTIN     DD *                                       
----+----1----+----2----+----3----+----4----+----5----+-
975,       97515384,12/27/2006,12/27/2006, 000026373.00
975,       97515384,12/27/2006,02/10/2009, 000026373.00
975,       97515384,12/26/2007,12/26/2007, 000026373.00
975,       97515384,12/26/2007,02/10/2009, 000026373.00
975,       97515384,12/22/2008,12/22/2008, 000026373.00
975,       97515384,12/22/2008,02/10/2009, 000026373.00
975,       97515384,11/28/2008,11/28/2008, 000052746.00
975,       97515384,11/28/2008,02/10/2009, 000079119.00
975,       97515384,11/27/2006,02/10/2009, 000026373.00
975,       97515384,11/26/2007,11/26/2007, 000026373.00
975,       97515384,11/26/2007,02/10/2009, 000079119.00
975,       97515384,10/23/2006,02/10/2009, 000026373.00
975,       97515384,10/22/2007,02/10/2009, 000026373.00
975,       97515384,10/20/2008,10/20/2008, 000052746.00
975,       97515384,10/20/2008,02/10/2009, 000026373.00
975,       97515384,09/25/2008,09/25/2008, 000026373.00
975,       97515384,09/25/2008,02/10/2009, 000079119.00
//SORTOUT    DD SYSOUT=*                           
//SYSOUT DD SYSOUT=*                               
//SYSIN      DD *                                   
           SORT FIELDS=COPY                         
           INCLUDE COND=(32,10,CH,EQ,C'02/10/2009')
/*                                                 


Output:

Code:
975,       97515384,12/27/2006,02/10/2009, 000026373.00
975,       97515384,12/26/2007,02/10/2009, 000026373.00
975,       97515384,12/22/2008,02/10/2009, 000026373.00
975,       97515384,11/28/2008,02/10/2009, 000079119.00
975,       97515384,11/27/2006,02/10/2009, 000026373.00
975,       97515384,11/26/2007,02/10/2009, 000079119.00
975,       97515384,10/23/2006,02/10/2009, 000026373.00
975,       97515384,10/22/2007,02/10/2009, 000026373.00
975,       97515384,10/20/2008,02/10/2009, 000026373.00
975,       97515384,09/25/2008,02/10/2009, 000079119.00
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Tue May 05, 2009 6:38 pm    Post subject: Reply to: Want to remove some unwanted records
Reply with quote

this is just a sample

i want to make it a generic sort

I would have used include cond if this would have been specific for this fileset.

Sorry if i was not self explanatory
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Tue May 05, 2009 6:46 pm    Post subject:
Reply with quote

Could you be more specific please.

What do you mean by generic sort? you mean wherever you find the particular word, you want to extract it?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 05, 2009 9:12 pm    Post subject:
Reply with quote

Vishal,

Your requirement is not clear. You need to explain in more detail what you want to do.

I can take a guess that maybe you want to set up the field and test constant separate from the control statements, but I really have no idea if that's it based on what you've said so far. However, if that's what you want to do, you can set up your field and test constant as DFSORT Symbols and use the symbols in the control statements. For example, something like this:

Code:

...
//SYMNAMES DD *
FLD,32,10,CH
TESTCON,'02/10/2009'
...
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(FLD,EQ,TESTCON)
/*


If that's not what you want to do, then you need to provide a better explanation of what you want to do.
Back to top
View user's profile Send private message
maheshvamsi

New User


Joined: 22 Mar 2008
Posts: 39
Location: bangalore

PostPosted: Tue May 05, 2009 11:06 pm    Post subject:
Reply with quote

Vishal wrote:
i want to make it a generic sort


Frank i also didn't understood from vishal post, what he ment by Generic sort, thats why I am asking him for more information.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue May 05, 2009 11:10 pm    Post subject:
Reply with quote

Sorry, I got the names wrong. My post should have been addressed to Vishal, not you. I've fixed it.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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