IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Why we need to use work files in sorting


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Fri Jul 21, 2006 11:09 am
Reply with quote

Hi all,

Please let me know why we need to use work files in sorting and what is the basic purpose of work files.

how many minimum work files we need to use and how many maximum work files we can give.

If i crossed maximum work files what will happen.

Please clarify me regarding all these queries.

Thanks in advace for all of you.

Thanks and Regards,
Samba.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Fri Jul 21, 2006 11:37 am
Reply with quote

Hi,

For Sorting or Merging, MVS requires some tempory space for the process. We specify SORTWORKFILEs when we sort in JCL.
We declare an Intermediate file in File Section SD.(Sort Description).

The minimum work files depend upon the volume of records being sorted.
It is a long process to find out what exactly the number of sort work files to be defined taking into consideretion RECL and No of records. Please refer SME. . We usually go for trail and error method. We expect what max no of records comes for sorting and we based on that we allocate sortwork files. icon_confused.gif

If step exceed the maximum space allocated space, then the process will abend.

~Vamsi
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Fri Jul 21, 2006 11:45 am
Reply with quote

Hi Vamsi,

Thanks a lot for valuable information.

Thanks and Reagrds,
Samba.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Jul 21, 2006 8:28 pm
Reply with quote

Quote:
Please let me know why we need to use work files in sorting and what is the basic purpose of work files.


The very short, simplified answer: The records to be sorted are held in available memory. When there isn't enough available memory to hold all of the records to be sorted, we have to write each set of records that will fit in memory to work data sets as sorted strings, and then read back and merge all the sorted strings to get the final output.

Quote:
how many minimum work files we need to use and how many maximum work files we can give.


For DFSORT, the minimum number of work data sets is 1 and the maximum number of work data sets is 255.

Quote:
If i crossed maximum work files what will happen.


If you specify more than 255 SORTWKdd DD statements, DFSORT will ignore the extra ones. If you specify more than 255 work data sets for dynamic allocation, for example DYNALLOC=(,256), DFSORT will use 255 work data sets.

Quote:
It is a long process to find out what exactly the number of sort work files to be defined taking into consideretion RECL and No of records. Please refer SME. . We usually go for trail and error method. We expect what max no of records comes for sorting and we based on that we allocate sortwork files.


This is a bad strategy and not necessary. The best strategy is to allow DFSORT to use dynamic allocation of work data sets, so it can automatically adjust the amount of work space it allocates automatically based on information it collects for each job.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Fri Jul 21, 2006 11:48 pm
Reply with quote

Frank,
A small question on this.

Is it a default that DFSORT will automatically allocate the space or is there any chace that this feature(automatic allocation) can be deactivated if needed ?

Thank you
Krishy
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jul 22, 2006 1:25 am
Reply with quote

DFSORT's shipped installation default is DYNAUTO=YES which says to dynamically allocate work data sets when needed provided SORTWKdd DD statements are not present. The site can change this default to DYNAUTO=NO which turns dynalloc off (although DFSORT will use it anyway in some cases), or to DYNAUTO=IGNWKDD which says to deallocate any SORTWKdd DD data sets and use dynalloc.

If you want to deactivate dynalloc at run-time, you can use:

Code:

//DFSPARM DD *
  OPTION DYNALLOC=OFF
/*


However, when Hipersorting or dataspace sorting is in effect, DFSORT will use dynamic allocation when necessary, even if DYNALLOC=OFF has been specified.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Mon Jul 24, 2006 11:32 pm
Reply with quote

Thaks a lot Frank !

Thank you
Krishy
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top