IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to remove some unwanted records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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 Developer


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

PostPosted: Tue May 05, 2009 9:12 pm
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
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 Developer


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

PostPosted: Tue May 05, 2009 11:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top