Possible to stop SORT before EOF?



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Possible to stop SORT before EOF?

Postby johng » Mon Feb 14, 2011 8:38 pm

I have as i/p a few million records.
- The i/p file is sorted on a key and is QSAM
- I know what the key is
- I want to get only records of a certain key and sort on a date.

So my question:
- Is there a way to tell sort to STOP reading the i/p after reaching a "key" that is > than the key i am after?

I don't see any, i found the STOPAFT but i don't know how many records there will be for a particular "key".

Thx,
John
johng
 

Re: Possible to stop SORT before EOF?

Postby Alissa Margulies » Tue Feb 15, 2011 12:33 am

Maybe I am misunderstanding, but if you only want to sort records with a particular key, then why not just code an INCLUDE COND for that key?
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Possible to stop SORT before EOF?

Postby steve-myers » Tue Feb 15, 2011 12:57 am

Alissa / JohnG - I was thinking the same idea, but since I don't know Syncsort all that well, I could not post it. Then I realized JohnG's SORTIN is sorted by the test key, and he wants to stop reading the SORTIN data after the last record that matches the condition has been read; just the INCLUDE COND statement means the entire SORTIN dataset is read.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Possible to stop SORT before EOF?

Postby johng » Tue Feb 15, 2011 2:57 am

steve-myers wrote:Then I realized JohnG's SORTIN is sorted by the test key, and he wants to stop reading the SORTIN data after the last record that matches the condition has been read; just the INCLUDE COND statement means the entire SORTIN dataset is read.


Steve, yes that's what i would like to do.

Alissa,
the file is created by sorting pos 1-4 & i know what i need in the already sorted positions 1-4. I don't want to read the entire file once i have what i need.
Wondering if there's a SYNCSORToption i'm missing, looking for something like: IF 1-4 > "ABCD" assume EOF.
johng
 

Re: Possible to stop SORT before EOF?

Postby BillyBoyo » Wed Feb 16, 2011 5:35 am

I imagine it'll be deleted again, but a lot of these recent syncsort queries would be really easy in Easytrieve Plus (other software products may be available) if you have access to it. Or Cobol.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Possible to stop SORT before EOF?

Postby dick scherrer » Wed Feb 16, 2011 9:45 am

Hello,

Yes, this too should be deleted. . .

When someone is looking for a solution that uses a particular product, it is best to confine the replies/suggestions to that particular product.

If someone posts a general "how can i" question, i believe that various suggestions are ok :)

Also, several of my clients do not have Easytrieve and when used it does require much more system resources than the sort. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Possible to stop SORT before EOF?

Postby BillyBoyo » Wed Feb 16, 2011 1:06 pm

Easytrieve uses the installed system sort (for sorting).

To join three seperate pre-sorted files, you use sort?

To update headers and trailers?

To stop after a particular key on the input file (so as not to read the whole file)?

If your only tool is a hammer, then your only solution is a nail. I'm just wondering if anybody has other tools (one of my other deleted posts was in response to a guy who had suggested himself to write some Cobol).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Possible to stop SORT before EOF?

Postby johng » Wed Feb 16, 2011 4:40 pm

For whatever reason the shop i'm currently at (as a consultant) does not allow internal sorts. I asked why but i forget the answer.
SyncSort is amazingly fast. If it can do what i want and the file(s) are BIG, i'll use it in a second.

Possible Syncsort "enhancement", In a IFTHEN statement maybe a "DONE" function.

Thanks All.
John
johng
 

Re: Possible to stop SORT before EOF?

Postby dick scherrer » Thu Feb 17, 2011 12:43 am

Hello,

Easytrieve uses the installed system sort (for sorting).
Which has nothing to do with anything in this topic as far as i can see . . . :?

Easytrieve uses far more cpu because it is nearly always interpreted rather than executed.

One of the problems with learning / getting a hammer is that there is a tendency to see too many "things" as a nail.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Possible to stop SORT before EOF?

Postby BillyBoyo » Thu Feb 17, 2011 5:17 am

dick scherrer wrote:Which has nothing to do with anything in this topic as far as i can see . . .


Previous post was commenting on good performance of Syncsort. Easytrieve Plus will use Syncsort (or whatever is installed).

dick scherrer wrote:Easytrieve uses far more cpu because it is nearly always interpreted rather than executed.


In batch? Where you're likely to be using Syncsort? Hey, I suppose there may be some online Easytrieve Plus, I don't know, but if you are running it in batch, it is compiled - or to put it another way, I'd like to see your PARM statement to "interpret" it.

I once used a product called EZ/KEY from Pansophic which was a "development environment" for Easytrieve Plus. Sure flattened the CPU if you tried to do a SYNTAX check.

I've never seen any performance problems with Easytrieve Plus. At one site, to get authorisation to use it in production, we had to "race" against equivalent COBOL programs. On seeing the results, the production department wanted to order us to write every program possible in Easytrieve rather than COBOL. We didn't do it that way, we used whichever we thought was most appropriate, but we certainly never worried about performance.

We also generated Easytrieve record layouts from the Data Dictionary, so same as the COBOL. Then, when you do your sort, in Easytrieve Plus, using Syncsort, in the Easytrieve you are referring to data names, not offsets in the file (never had to worry about those 4 bytes on a variable-length record). Then even the business analysts could read the sorts.

If anyone has performance problems with Easytrieve Plus, and happens to be reading this Syncsort forum, and wants them looked at, stick a question in the Easytrieve forum.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post