JCL ICEMAN how many sort files are needed?

Doug Hauf picture Doug Hauf · Jan 6, 2014 · Viewed 8.2k times · Source

I am working with JCL and there is what is called an ICEMAN which is which is invoked when the IBM SORT utility DFSORT is used. DFSORT can be used to SORT, COPY or MERGE files, amongst other things. In the example below there the output is from a SORT. My question is how many sortwork (//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,30)) files are needed. They seem to me to always vary in number when I see them in JCL. Is there a formula for this to figure the size of how many SORTWKnns are needed?

JCL Code:

//STEP5    EXEC PGM=ICEMAN,COND=(4,LT)                 
//SYSOUT    DD  SYSOUT=1                               
//SYSIN     DD  DSN=CDP.PARMLIB(cardnumberhere),DISP=SHR     
//SORTIN    DD  DSN=filename,DISP=SHR            
//SORTOUT   DD  DSN=filename,DISP=(OLD,KEEP),  
//          DCB=(LRECL=5000,RECFM=FB),                 
//          SPACE=(CYL,30)                             
//SORTWK01  DD  UNIT=SYSDA,SPACE=(CYL,30)              
//SORTWK02  DD  UNIT=SYSDA,SPACE=(CYL,30)              
//SORTWK03  DD  UNIT=SYSDA,SPACE=(CYL,30)              
//SORTWK04  DD  UNIT=SYSDA,SPACE=(CYL,30)              

Answer

cschneid picture cschneid · Jan 6, 2014

It is common for JCL to be copied from one jobstream to the next, and the next, and the next, resulting in replicative fade.

According to the documentation...

//SORTWKdd DD

Defines intermediate storage data sets. Usually needed for a sorting application unless dynamic allocation is requested. Will not be used for a copying or merging application.

Dynamic allocation is requested via the DYNALLOC option. Some shops have this set as the default.

If you want, you can manually calculate the required work space. Typically 1.5 to 2 times the size of the input file is adequate. Always allocate more than 1 SORTWKdd DD statement for efficiency. Avoid allocating a large number of SORTWKdd DD statements.