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 

SORT - Why no file contention

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


Joined: 20 Dec 2014
Posts: 47
Topics: 11

PostPosted: Fri Dec 05, 2025 3:32 am    Post subject: SORT - Why no file contention Reply with quote

Hello,

Sorry for the silly doubt but I was under the impression that below SORT will result in file contention as SORTIN and SORTOUT file are same but job completed successfully and result was as expected(excluded few records).

Code:
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SANTOSH.TEST,DISP=OLD
//SORTOUT DD DSN=SANTOSH.TEST,DISP=OLD
//SYSIN DD *
 SORT FIELDS=COPY
 OMIT COND=(9,2,CH,EQ,C'AB')
/*

_________________
Regards, Santosh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Fri Dec 05, 2025 8:20 am    Post subject: Reply with quote

rsantosh,

The ENQueue of the dataset is reserved based on the jobname. In this case it is the jobname that is running. So you wouldn't get the contention error.

Btw using the same dataset for input and output for a COPY operation may cause unpredictable results. You can check the restriction here

https://www.ibm.com/docs/en/zos/3.2.0?topic=statement-general-coding-notes

More on this topic
https://www.mvsforums.com/helpboards/viewtopic.php?t=2831
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rsantosh
Beginner


Joined: 20 Dec 2014
Posts: 47
Topics: 11

PostPosted: Fri Dec 05, 2025 12:16 pm    Post subject: Reply with quote

Thank you so much. I can relax now. Smile
_________________
Regards, Santosh
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Fri Dec 05, 2025 12:30 pm    Post subject: Reply with quote

rsantosh wrote:
Thank you so much. I can relax now. Smile


rsantosh,

Did you overlook this statement in my post?

Kolusu wrote:
Btw using the same dataset for input and output for a COPY operation may cause unpredictable results.

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rsantosh
Beginner


Joined: 20 Dec 2014
Posts: 47
Topics: 11

PostPosted: Fri Dec 05, 2025 1:37 pm    Post subject: Reply with quote

I did notice it and checked both the links. Whole day I was wondering why no contention bonk your reply was relieving Very Happy
_________________
Regards, Santosh
Back to top
View user's profile Send private message
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