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 

Stop reading after meeting certain condition

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


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Jun 28, 2017 10:13 am    Post subject: Stop reading after meeting certain condition Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 28, 2017 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Jun 28, 2017 11:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Jun 28, 2017 11:19 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 28, 2017 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 28, 2017 11:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Wed Jun 28, 2017 1:48 pm    Post subject: Reply with quote

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 Sad

Thanks
Magesh
Back to top
View user's profile Send private message
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