On 2/22/2012 12:27 PM, Ulrich Krueger wrote:
Thank you for your response, Staffan.
To the best of my knowledge (and, being retired, I cannot experiment with a
current release of DFSORT), there's no way I can think of to make DFSORT
_not_ allocate SORTWKs for every invocation. So I had been thinking along
the lines of "How can I avoid the _entire_ overhead of invoking SORT
multiple times?" With or without SORTWKs, the cumulative overhead of
invoking SORT (as you said) 1000's of times ... that's going to kill your
performance. If there's any chance to rework the program's logic, similar to
what I said in my previous post, and call SORT only once ... that's going to
give you the best bang for your buck.
I hope, you can find a solution to your problem.
Perhaps posting the SORT messages for one of the invocations might help shed
some more light on the issue.
Regards,
Ulrich Krueger
So, DFSORT is being invoked from a program, as I recall. Here's
an idea: have the program call the C qsort function instead of
DFSORT.
I have a simple COBOL program that does this:
01 no-rows pic s9(9) binary value 0.
01 row-size pic s9(9) binary value +60.
01 compdesc function-pointer.
...
01 parts-table.
05 parts occurs 300 times
indexed by part-index.
10 parts-no pic x(9).
10 parts-desc pic x(30).
10 parts-on-hand pic 99999.
10 parts-on-ord pic 999.
10 parts-price pic 9999v999.
10 parts-reord pic 999.
10 pic xxx.
...
procedure division using parms.
mainline.
set compdesc to entry 'compdesc'
...
call 'qsort' using
parts-table,
by value no-rows,
row-size,
compdesc
The routine 'compdesc' is where the actual compare takes
place. Since I am comparing the descrption field (parts-desc
in the table above), I wrote the following Assembler code:
COMPDESC CSECT
COMPDESC AMODE 31
COMPDESC RMODE ANY
* Copyright (C) 2004 by Steven H. Comstock
*
* code to be called as a C function to compare two consecutive
* entries in a table of Inventory items, in process of
* sorting by description field, which is 9 bytes in
* with a length of 30; no save area is used or
* needed, and code returns zero if two items
* equal, positive number if first is high,
* negative number if first is low
*
l 15,0(1)
l 1,4(,1)
clc 9(30,15),9(1)
je zero
jh high
lnr 15,15
high ds 0h
br 14
zero ds 0h
sr 15,15
br 14
dc c'compdesc ver1'
END COMPDESC
So, could you code a similar program to do the compare
between two entries then invoke the C qsort using your
routine for the compare?
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Staffan Tylen
Sent: Wednesday, February 22, 2012 11:08 AM
To: [email protected]
Subject: Re: Avoiding DFSORT dynamic allocatoin, was: Abend S0C4 in an
internal sort
David, Ulrich,
Many thanks for your comments but I think we are drifting away from the
original issue, namely that there seems to be no way to prevent dynamic
allocation of sort work files. I wish to be able to sort records in storage
without "risking" that work files are dynamically allocated. I know this may
sound silly but that's not the point. The point I'm making is that the
documentation for DFSORT seems to show ways to do this using various
parameters such as DYNALLOC, FILESZ, etc. but I can't make it work.
Many thanks for any continued input to this.
Staffan
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-355-2752
http://www.trainersfriend.com
* To get a good Return on your Investment, first make an investment!
+ Training your people is an excellent investment
* Try our tool for calculating your Return On Investment
for training dollars at
http://www.trainersfriend.com/ROI/roi.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN