View previous topic :: View next topic
Author
Message
vishal_arora New User Joined: 20 May 2005Posts: 16
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
maheshvamsi New User Joined: 22 Mar 2008Posts: 39 Location: bangalore
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
vishal_a New User Joined: 24 May 2005Posts: 45 Location: Noida
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
maheshvamsi New User Joined: 22 Mar 2008Posts: 39 Location: bangalore
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
maheshvamsi New User Joined: 22 Mar 2008Posts: 39 Location: bangalore
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Sorry, I got the names wrong. My post should have been addressed to Vishal, not you. I've fixed it.
Back to top
Please enable JavaScript!