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
 

 

for large files, can sort input & outfile be the same fi

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Tue Jul 08, 2014 2:37 am    Post subject: for large files, can sort input & outfile be the same fi
Reply with quote

eg.
Code:

//SORTIN    DD DISP=SHR,DSN=A
//SORTOUT DD DISP=SHR,DSN=A
//SYSIN       DD *
   option copy
   outrec ifthen=(when=(condition),overlay=())
/*


for small files, the result is OK.
for large files, sorting completed, return code is 0, but number of record in output file is much less.

does anyone know the difference?
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1491
Location: Chennai

PostPosted: Tue Jul 08, 2014 3:41 am    Post subject:
Reply with quote

Hello,
Quote:
For a copy application, the SORTIN data set should not be the same as the SORTOUT data set or any OUTFIL data set because this can cause lost or incorrect data or unpredictable results.

For a sort application, the SORTIN data set should not be the same as any SORTWKdd data set because this can cause lost or incorrect data or unpredictable results. The SORTIN data set can be the same as the SORTOUT data set or an OUTFIL data set, but this situation can lead to the loss of the data set if the sort application does not end successfully.

Simply said, don't use the same file as Input and Output.
http://ibmmainframes.com/about56709.html

Hope it helps,
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 516
Location: The Universe

PostPosted: Tue Jul 08, 2014 3:55 am    Post subject:
Reply with quote

For a sorting application, the input and output data set can specify the same data set. It is not recommended, but it will work because sort reads the entire input data set before it writes an output record.

For a copy application it will not work, as Vasanth already noted.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
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


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