View previous topic :: View next topic |
Author |
Message |
Magesh_J Intermediate
Joined: 21 Jun 2014 Posts: 259 Topics: 54
|
Posted: Wed Jun 28, 2017 10:13 am Post subject: Stop reading after meeting certain condition |
|
|
Hi,
Is there way to foce stop a sort program after meeting certain conditions.
if 1,2,ch,gt,C'05' then stop read.
I know we have
include cond, but it will read all the records.
I also know stopaft=, but still we can handle this only for fixed number of records.
Thanks
Magesh |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
Posted: Wed Jun 28, 2017 10:59 am Post subject: |
|
|
Magesh_J,
what exactly are you trying to solve? You do realize that your stopaft works after the INCLUDE cond ?
for example
Code: |
INCLUDE COND=(1,2,CH,GT,C'05')
OPTION STOPAFT=1 |
we would stop the I/O right after getting the first record. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Magesh_J Intermediate
Joined: 21 Jun 2014 Posts: 259 Topics: 54
|
Posted: Wed Jun 28, 2017 11:14 am Post subject: |
|
|
Kolusu wrote: |
unless you have a huge file and only few records match the criteria
|
Thanks for the quick response.
Yes, huge file 18 millions records, out of which i need only 30K records.
I am converting some DYL(Computer associate product) programs and view direct(mobius) program to SORT.
In those programs they are easily stopping the program to read after certian records.
30k records lies between 1 million to 2 million records, after that i dont need to read it, but never know it for sure.
But sort unnessarily reading all the 18 million records.
Thanks
Magesh |
|
Back to top |
|
|
Magesh_J Intermediate
Joined: 21 Jun 2014 Posts: 259 Topics: 54
|
Posted: Wed Jun 28, 2017 11:19 am Post subject: |
|
|
example :
input
Code: |
01
02
03
04
04
04
05
06
07
|
expected output
output
Code: |
01
02
03
04
04
04
05
|
In the above example, we have to avoid reading 06 and 07 records. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
Posted: Wed Jun 28, 2017 11:27 am Post subject: |
|
|
Magesh_J wrote: | Kolusu wrote: |
unless you have a huge file and only few records match the criteria
|
Thanks for the quick response.
Yes, huge file 18 millions records, out of which i need only 30K records.
I am converting some DYL(Computer associate product) programs and view direct(mobius) program to SORT.
In those programs they are easily stopping the program to read after certian records.
30k records lies between 1 million to 2 million records, after that i dont need to read it, but never know it for sure.
But sort unnessarily reading all the 18 million records.
Thanks
Magesh |
Well the problem is that SORT does not KNOW the data is sorted, so it keeps on checking till the end of the file.
But I would love to see the DFSORT job stats with a COPY and DYL program stats and see how much of a difference you have. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
|
Posted: Wed Jun 28, 2017 11:32 am Post subject: |
|
|
Magesh_J wrote: | example :
input
Code: |
01
02
03
04
04
04
05
06
07
|
expected output
output
Code: |
01
02
03
04
04
04
05
|
In the above example, we have to avoid reading 06 and 07 records. |
Hmm unless you are using an OMIT condition you should be reading ONLY 06 & 07 records as the condition is using GT '05' and only 06 and 07 would satisfy the condition. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Magesh_J Intermediate
Joined: 21 Jun 2014 Posts: 259 Topics: 54
|
Posted: Wed Jun 28, 2017 1:48 pm Post subject: |
|
|
Kolusu wrote: |
But I would love to see the DFSORT job stats with a COPY and DYL program stats and see how much of a difference you have.
|
I wish to do that, but Our shop got updated to syncsort
Thanks
Magesh |
|
Back to top |
|
|
|
|