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

Empty KSDS Files


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

New User


Joined: 20 Aug 2015
Posts: 3
Location: Gurgaon

PostPosted: Fri Aug 21, 2015 2:44 pm
Reply with quote

I have 2 KSDS Files, One which I deleted defined and it contains No Records. And the other KSDS File, from which I deleted all the records.

There is a difference in these 2 files, Can anybody please let me know what it is.
When i am browsing the first one, I am not able to browse it, it says Empty File. But I can browse the second file, although that also does not have any record. I tried giving the 2 files in JCL as input. For first one, JCL fails with file status code 35, as we all know we can not open empty VSAM file for input. But with Second type of file, JCL runs smoothly without giving any error
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 21, 2015 3:50 pm
Reply with quote

To be opened successfully for reading, a KSDS must have had at least one record written to it, even if it currently contains no records.
Back to top
View user's profile Send private message
Jeenu Bajaj

New User


Joined: 20 Aug 2015
Posts: 3
Location: Gurgaon

PostPosted: Fri Aug 21, 2015 4:11 pm
Reply with quote

But when I deleted all records from KSDS File, I was still able to browse the file
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 21, 2015 4:25 pm
Reply with quote

Yes.... and?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 21, 2015 5:48 pm
Reply with quote

You need to find and read the Redbook VSAM Demystified where you can find all sorts of information about VSAM. The behavior you posted is normal and expected -- VSAM distinguishes between an empty file (that has never had a record) and a file with no records in it. They are not the same, so why would you expect the browse (or anything else, for that matter) to work the same?
Back to top
View user's profile Send private message
Jeenu Bajaj

New User


Joined: 20 Aug 2015
Posts: 3
Location: Gurgaon

PostPosted: Fri Aug 21, 2015 7:01 pm
Reply with quote

Ok. Got it!! Thanks a ton guys for your answers!!
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 580
Location: London

PostPosted: Tue Sep 08, 2015 2:48 am
Reply with quote

Jeenu..once you load a record to a VSAM file it formats the Control Interval (or CI...kind of like a block in NONVSAM terms) and leaves it formatted even if you delete the record.

If no record is ever loaded to the file there are no formatted CI's and VSAM recognises the difference.

There's a program around on the web called VSAMINIT that will 'initialise' a file for you by inserting and (optionally) deleting a record into the file, but you could write your own version to.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top