IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Disposition SHR - Append or Overwrite


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ragin

New User


Joined: 20 Feb 2005
Posts: 16

PostPosted: Fri Mar 04, 2005 7:31 am
Reply with quote

Hello Friends,
1. If i am opening a file in output mode which has disposition as SHR then what will happen if i am writing in to it.

options are

a. it will get append to it.
b.it will get overwrite.

2.If i am opening a file in output mode which has disposition as MOD
then what will happen if i am writing in to it.

options are

a. it will get append to it.
b.it will get overwrite

Please reply to these questions immediately.
Back to top
View user's profile Send private message
vishal_09

New User


Joined: 16 Feb 2005
Posts: 6
Location: hyderabad

PostPosted: Fri Mar 04, 2005 9:29 am
Reply with quote

hii
if u want to append u must open a file in i-o mode ...............if the file already exist...else u can open in output mode.................
Back to top
View user's profile Send private message
mainframemouli

New User


Joined: 01 Mar 2005
Posts: 52
Location: Mysore

PostPosted: Fri Mar 04, 2005 10:40 am
Reply with quote

Heres the Small answer for your BIg Doubt.

If File Disp filed in JCL for a file is SHR and if u opened the file in output mode then, whatever you write into that file will be overwritten.

if the File Disp field in JCL for a file is MOD and if the file in ouput mode then, whatever you write into the file will be appended.

hope this helps.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Mar 05, 2005 9:21 pm
Reply with quote

Hi vishal,

You don't have to open a file I/O to append to it. You can do either of the following:

1) Open it output extend
2) Code MOD in the DISP for the file.

P.S. Writing to a file using SHR can be dangerous. This allows simultaneous updates to the file, leaving it open to being "corrupted". I.e. damaged.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Duplicate data in PUT CONTAINER using... CICS 4
No new posts I want to append a record in an exist... CLIST & REXX 17
No new posts How to append Previous date into a S... JCL & VSAM 2
Search our Forums:

Back to Top