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 

Cobol - File open with OUTPUT mode and in JOB DISP as MOD

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


Joined: 27 Dec 2002
Posts: 46
Topics: 15

PostPosted: Mon May 09, 2005 1:05 am    Post subject: Cobol - File open with OUTPUT mode and in JOB DISP as MOD Reply with quote

As per Cobol language reference
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon May 09, 2005 9:03 am    Post subject: Reply with quote

Novice,
Quote:

I tried the same and got the records appended at the end and wanted to know why the
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon May 09, 2005 7:39 pm    Post subject: Reply with quote

DISP=MOD means treat the end of an existing file as if it was the beginning (well, sort of). I don't know anything about COBOL I/O per se, but I assume it is BSAM or QSAM and those access methods simply start writing at the end of the file with DISP=MOD. I doubt that it would do a POINT to the actual first record. I'm not even sure BSAM alows that with DISP=MOD, though if it does not, they could open an alternate DCB, I suppose.
Back to top
View user's profile Send private message Visit poster's website
Novice
Beginner


Joined: 27 Dec 2002
Posts: 46
Topics: 15

PostPosted: Mon May 09, 2005 11:08 pm    Post subject: Reply with quote

Kolusu,

Quote:

When you open the File in OUTPUT MODE in cobol , the end-of-file Indicator is moved to the first record in the file, there by deleting the old data.


I am aware of opening a file in OUTPUT mode will erase all the existing records. My question is If an existing file is opened with OUTPUT MODE in cobol and disposition is mentioned as MOD, which of these will take higher precedence ? The Cobol language OUTPUT mode or JCL DISPOSITION parameter ? Although My result shows that DISP=MOD takes higher precedence, I would liuke to have the views of the members.

regards
Novice
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 10, 2005 7:26 am    Post subject: Reply with quote

Quote:

My question is If an existing file is opened with OUTPUT MODE in cobol and disposition is mentioned as MOD, which of these will take higher precedence ? The Cobol language OUTPUT mode or JCL DISPOSITION parameter ? Although My result shows that DISP=MOD takes higher precedence, I would liuke to have the views of the members.


Novice,

The JCL Disp parameter takes precedence and hence your data is appended at the end even though you opened the file in OUTPUT mode.

Hope this helps...

Cheers

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


Joined: 27 Dec 2002
Posts: 46
Topics: 15

PostPosted: Tue May 10, 2005 11:39 pm    Post subject: Reply with quote

Thanks Kolusu

Novice
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 -> Application Programming 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