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 

Adding to a file if the DISP=OLD?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Sysaron
Beginner


Joined: 22 Feb 2004
Posts: 3
Topics: 3
Location: Los Angeles

PostPosted: Sun Feb 22, 2004 6:42 pm    Post subject: Adding to a file if the DISP=OLD? Reply with quote

Could you add more data sequencially if the file disp=OLD, of does it have to be disp=MOD? Will the previous data be overwritten if file is disp=old?
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Feb 22, 2004 10:43 pm    Post subject: Reply with quote

Hi,

To add data recs to a PS file use MOD. If you use OLD and write to the file, the existing data will be overwritten. Also, the data not overwritten is no longer available unless extraordinary methods are used to recover it.

HTH, Jack.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon Feb 23, 2004 2:56 pm    Post subject: Reply with quote

Err, Jack...

Don't you mean,
Quote:
Also, the data that is overwritten is no longer available unless extraordinary methods are used to recover it.


rather than,

Quote:
Also, the data not overwritten is no longer available unless extraordinary methods are used to recover it.
?

Also, you suggest a faint glimmer of hope when you say extraordinary methods can be employed to recover lost data. I always thought that, data once overwritten with DISP=OLD is gone...forever. Rolling Eyes
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Feb 23, 2004 6:40 pm    Post subject: Reply with quote

Not true Cogito-Ergo-Sum.

One example - If the dataset you were writing to was a member of a PDS then it would be rewritten at the end of the PDS and the previous space taken up by the member would be marked as inaccessible until a compress was done. This data could be accessed by means of stealth!
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Feb 23, 2004 8:25 pm    Post subject: Reply with quote

From the COBOL manual:

To add to a QSAM file, open the file as EXTEND and use the WRITE statement to add records immediately after the last record in the file.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.9.2.3?DT=20020923143836#HDRWQ303
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Feb 23, 2004 11:39 pm    Post subject: Reply with quote

You've lost me Superk?! When did COBOL come into the equation?
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Feb 24, 2004 12:13 am    Post subject: Reply with quote

Since JCL cannot by itself accomplish anything with data, other than to allocate the appropriate dataset using the specified disposition, then some sort of program must be invoked to accomplish the creation and/or addition of data to the dataset. Since no reference was made to any particular program requirements, I presume that any type of program is open for discussion within the context of this subject.
Back to top
View user's profile Send private message
semigeezer
Supermod


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

PostPosted: Tue Feb 24, 2004 12:45 am    Post subject: Reply with quote

Quote:

Don't you mean,
Quote:
Also, the data that is overwritten is no longer available unless extraordinary methods are used to recover it.


The original statement (data that is not overwritten) is fine. There is the PDS case, though one should not open a PDS with DISP=MOD, but there is also data remaining on the disk if less data is written than existed before. The old data still follows the EOF mark. That was the problem in the old days when no EOF mark was written by dynamic allocation, so you could read residual data ... big security problem.
Back to top
View user's profile Send private message Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Tue Apr 20, 2004 10:01 am    Post subject: Reply with quote

Superk is correct. Using the appropriate OPEN in most languages will allow extension of a PS file. But you usually don't have that capability when using utilities. You're stuck w/OLD or MOD, so be careful, you can overwrite the existing data.

And CES, I did mean "not overwritten". You could probably use DITTO or some other sysprog magic, provided the data beyond the file mark was not reallocated and overwritten by another task.

Regards, Jack.
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 -> Job Control Language(JCL) 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