Page 1 of 1

Do we really require SORTWORK files in a SORT JCL?

Posted: Mon Apr 12, 2021 1:48 pm
by Ashish Pawar
Hi,

Do we really require SORTWORK files in a SORT JCL? I've seen it is working both the way, with or without them, so what si the rule? Please suggest.

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Tue Apr 13, 2021 1:09 am
by Robert Sample
From the manual:
z/OS DFSORT Application Programming Guide
SC23-6878-00


One or more SORTWKdd statements are required for each sort application (but not a merge or copy), unless:
Input can be contained in main storage
Dynamic work space allocation has been requested (DYNALLOC)
dataspace sorting, Hipersorting, or memory object sorting is used.
So if you're doing a merge or copy you don't need SORTWKdd statements. The other cases when you don't need them is when the sort is small enough to fit into main storage (which these days could be multiple gigabytes), or you're using dynamic allocation, or you're using specific types of sorts. In all other cases, you must have SORTWKdd statements.

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Wed Apr 21, 2021 11:09 pm
by Ashish Pawar
Thanks Robert.

Code: Select all

//S1      EXEC  PGM=ICEMAN                          
//SYSOUT  DD  SYSOUT=*                              
//SORTIN  DD DSN=TEST.MQTEST.ERRORS,DISP=SHR       
//SORTOUT DD DSN=MISZD2.TEST.MQTEST.ERRORS,        
//           DISP=(NEW,CATLG,DELETE),               
// SPACE=(CYL,(5,5)),UNIT=SYSDA,RECFM=VB,LRECL=231  
//SYSIN   DD *                                      
  OPTION COPY                                       
/*                                                  
//*
It worked. But when I used SORTWK file, It worked then too and the SYSOUT showed that it did allocate SORTWK files? What does that mean?

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Thu Apr 22, 2021 1:21 am
by giskard reventlov
the use of explicit SORTWK allocation in jcl depends on the standards in use
for <normal>/<everyday> sorts Your support has certainly configured dfsort with the proper dymamic allocation parameters

for these things ALWAYS refer to Your storage support group , they know how the system was set-up

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Fri Apr 30, 2021 2:07 pm
by Ashish Pawar
Thanks giskard.

I work from offshore and storage support is not approachable for us at all. So I mostly reply on my own studies and website like this.

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Sun May 02, 2021 7:34 pm
by Robert Sample
But when I used SORTWK file, It worked then too and the SYSOUT showed that it did allocate SORTWK files? What does that mean?
If you put a DD statement in your JCL, generally there will be an allocation. It doesn't really mean much since you need to consider a variety of factors. It may have allocated the SORTWK DD statements, but did it use them?

Re: Do we really require SORTWORK files in a SORT JCL?

Posted: Tue Aug 03, 2021 12:13 pm
by Ashish Pawar
Robert Sample wrote: Sun May 02, 2021 7:34 pmIt may have allocated the SORTWK DD statements, but did it use them?
How do I verify that? I am not sure, can you please tell?