Some background, first. I was asked to help a COBOL application calling DFSORT internally via INPUT / OUTPUT PRODECURE (E15/E35) interface. The input data size is unknown, but varying greatly. FILESZ cannot be supplied. So, DFSORT has no way to calculate the required disk work space.
The application was asked to change from JCL allocated SORTWKnn to dynamically allocated sort work space. DFSORT options DYNALLOC, DYNAPCT, and DYNSPC are the options used to help DFSORT optimally allocate the sort work space. Some extracts from the manual are listed below. I read the relevant parts in the Installation & Customization, the Application Programmer, and the Tuning Guide, but still I'm not sure I understand how and when the work space data set are allocated. The disk space allocated is of special interest here. Suppose: DYNALLOC=(,8),DYNAPCT=50,DYNSPC=2400 Now here are the statements with a lot of uncertainty, and question marks. I'd appreciate confirmation, or correction where I'm wrong. a) DFSORT will allocate 8 initial work data sets with primary space, and 50% of that, i.e. 4 reserve data sets with zero space initially. The total amount of primary space is the equivalent of 2400 MB. The manual says this is the total over *all* work data sets. b) So, the primary space for each of the 12 work data sets is 200MB, but only the 8 initial ones are allocated with that primary amount. The 4 reserved data sets are initially allocated with 0 space, but 200 MB will be allocated once DFSORT decides it needs them. c) The secondary space is said to be 20% of the primary, i.e. 480MB. It is not clear to me, whether this means any secondary extent is 480MB, or whether the secondary value is 480MB / 12, i.e. 40MB. This greatly influences the theoretical total amount of workspace. d) When DFSORT decides it needs more space, will it extend one, some, or all of the additional work data sets? At this time, the initial work data set have probably been extended to their maximum size (1 x primary + 15 x secondary). Will the additional data sets be extended by the primary amount only, and will grow later as needed? e) The first extension amount used with d) will be the primary amount calculated above, i.e. 200MB, right? Later, these additional data sets can be expanded by the secondary extent value, up to 15 times. Correct? Extracts from the Application Programmer's Guide: DYNAPCT=x specifies additional work data sets to be dynamically allocated with zero space. DFSORT only extends these data sets when necessary to complete a sort application. x specifies the number of additional work data sets (y) as a percentage of the maximum number of dynamically allocated work data sets (DYNALLOC/DYNALOC n value) in effect. DYNSPC=n DYNSPC=n temporarily overrides the DYNSPC installation option, which specifies the total default primary space allocation for all of the dynamically allocated work data sets when the input file size is unknown. ..., DFSORT uses the DYNSPC value in effect as the approximate amount of primary space. DFSORT uses 20% of the primary space as secondary space. Although the primary space is always allocated, secondary space (up to 15 extents) is only allocated as needed. n specifies the total default primary space, in megabytes, to be allocated for all dynamically allocated work data sets (n is not the primary space for each data set). -- Peter Hunkeler ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
