MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SORTIN SORTOUT datasets

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Prayank
Beginner


Joined: 13 May 2003
Posts: 18
Topics: 9
Location: Indore,India

PostPosted: Sat Jan 10, 2004 2:48 am    Post subject: SORTIN SORTOUT datasets Reply with quote

Hi All,

Just wanted to know whether we can use same dataset for SORTIN and SORTOUT . Will the results be consistent ?

Code:
eg:
//PS010    EXEC PGM=SORT     
//*                     
//SYSOUT   DD  SYSOUT=(,)                         
//*
//SORTWK01 DD  UNIT=SCRPK,SPACE=(CYL,(1),,CONTIG) 
//SORTWK02 DD  UNIT=SCRPK,SPACE=(CYL,(1),,CONTIG) 
//SORTWK03 DD  UNIT=SCRPK,SPACE=(CYL,(1),,CONTIG) 
//*
//SORTIN   DD  DSN=BPOT.SWDT.C9468.V.DATA,DISP=SHR       
//SORTOUT  DD  DSN=BPOT.SWDT.C9468.V.DATA,DISP=SHR     
//*
//SYSIN    DD  *                                   
 SORT FIELDS=COPY                                 
 INCLUDE COND=(9,5,CH,EQ,X'FFFFFFFFFF')
/*


Prayank
Back to top
View user's profile Send private message
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Sat Jan 10, 2004 6:53 am    Post subject: Reply with quote

Try it out and let us know what u find.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Jan 10, 2004 11:39 am    Post subject: Reply with quote

Prayank,

In this case, mfjin's advice to try it out is NOT helpful since it won't tell you what you need to know. You can do these things, but in the case of copy, you shouldn't, and in the case of sort, you should only do it if you accept the possible consequences.

For a copy application, you should NOT use the same data set for SORTIN and SORTOUT. For copy, SORTIN reads and SORTOUT writes are done concurrently, so the writes can overlay what you're trying to read. It may work, but it may also fail or give you incorrect output.

For a sort application, you can use the same data set for SORTIN and SORTOUT. For sort, all of the SORTIN records are read before the SORTOUT writes are started, so the writes cannot overlay what you're trying to read. However, we call this a "suicide sort" because if the sort gets some kind of error before the output is complete, you may have partially overlaid the input data set making it unusable. So you should only use the same data set for SORTIN and SORTOUT if you can recover from having the SORTIN data set be unusable (for example, you have a backup of the SORTIN data set, or it's a temporary data set that you can recreate).

BTW, the SORTWKdd DDs in your copy job are not needed. Copy doesn't use work data sets. You're just wasting DASD space by using SORTWKs with copy.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group