Do we really require SORTWORK files in a SORT JCL?

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
Ashish Pawar
Registered Member
Posts: 20
Joined: Mon Aug 18, 2014 10:25 am

Do we really require SORTWORK files in a SORT JCL?

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Ashish Pawar
Registered Member
Posts: 20
Joined: Mon Aug 18, 2014 10:25 am

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

Post 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?
User avatar
giskard reventlov
Registered Member
Posts: 11
Joined: Wed Jul 29, 2020 4:42 pm

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

Post 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
Ashish Pawar
Registered Member
Posts: 20
Joined: Mon Aug 18, 2014 10:25 am

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

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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?
Ashish Pawar
Registered Member
Posts: 20
Joined: Mon Aug 18, 2014 10:25 am

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

Post 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?
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”