Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why we need to use work files in sorting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Why we need to use work files in sorting
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    Post subject: Re: Sorting
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    Post subject:
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 Moderator


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

PostPosted: Fri Jul 21, 2006 8:28 pm    Post subject:
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    Post subject: Re: Why we need to use work files in sorting
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 Moderator


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

PostPosted: Sat Jul 22, 2006 1:25 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us